Skip to content

Commit 5c8ea3a

Browse files
committed
完成 flag 包
1 parent eff077d commit 5c8ea3a

File tree

6 files changed

+503
-3
lines changed

6 files changed

+503
-3
lines changed

SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
- 9.4 [testing - 运行并验证示例](chapter09/09.4.md)
4848
- 9.5 [testing - 其他功能](chapter09/09.5.md)
4949
- 9.6 [httptest - HTTP 测试辅助工具](chapter09/09.6.md)
50+
- 9.7 [总结](chapter09/09.7.md)
5051
* [第十章 进程、线程与 goroutine](chapter10/10.0.md)
5152
- 10.1 [创建进程](chapter10/10.1.md)
5253
- 10.2 [进程属性和控制](chapter10/10.2.md)

chapter09/09.1.md

+3
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,9 @@ T结构内部是继承自common结构,common结构提供集中方法,是我
351351
Fatal : Log + FailNow
352352
Fatalf : Logf + FailNow
353353

354+
## 扩展阅读
355+
356+
[GO 中如何进行单元测试](http://blog.studygolang.com/2017/10/how-to-test-with-go/)
354357

355358
# 导航 #
356359

chapter09/09.6.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,4 @@ func TestMain(m *testing.M) {
150150
# 导航 #
151151

152152
- 上一节:[testing - 其他功能](09.5.md)
153-
- [第十章 进程、线程与 goroutine](chapter10/10.0.md)
154-
155-
153+
- 下一节:[总结](09.7.md)

chapter09/09.7.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# 总结 #
2+
3+
除了标准库提供的测试包,还有很多优秀的第三方测试包,比如 [https://github.com/stretchr/testify](https://github.com/stretchr/testify) 用于增强 testing 进行单元测试,进行 mock 等,有机会会写文章介绍它的使用;再比如,[https://github.com/onsi/ginkgo](https://github.com/onsi/ginkgo) 用于集成测试等等。
4+
5+
参考阅读:https://getstream.io/blog/how-we-test-go-at-stream/
6+
7+
# 导航 #
8+
9+
- 上一节:[httptest - HTTP 测试辅助工具](09.6.md)
10+
- [第十章 进程、线程与 goroutine](chapter10/10.0.md)
11+
12+

0 commit comments

Comments
 (0)