File tree 6 files changed +503
-3
lines changed
6 files changed +503
-3
lines changed Original file line number Diff line number Diff line change 47
47
- 9.4 [ testing - 运行并验证示例] ( chapter09/09.4.md )
48
48
- 9.5 [ testing - 其他功能] ( chapter09/09.5.md )
49
49
- 9.6 [ httptest - HTTP 测试辅助工具] ( chapter09/09.6.md )
50
+ - 9.7 [ 总结] ( chapter09/09.7.md )
50
51
* [ 第十章 进程、线程与 goroutine] ( chapter10/10.0.md )
51
52
- 10.1 [ 创建进程] ( chapter10/10.1.md )
52
53
- 10.2 [ 进程属性和控制] ( chapter10/10.2.md )
Original file line number Diff line number Diff line change @@ -351,6 +351,9 @@ T结构内部是继承自common结构,common结构提供集中方法,是我
351
351
Fatal : Log + FailNow
352
352
Fatalf : Logf + FailNow
353
353
354
+ ## 扩展阅读
355
+
356
+ [ GO 中如何进行单元测试] ( http://blog.studygolang.com/2017/10/how-to-test-with-go/ )
354
357
355
358
# 导航 #
356
359
Original file line number Diff line number Diff line change @@ -150,6 +150,4 @@ func TestMain(m *testing.M) {
150
150
# 导航 #
151
151
152
152
- 上一节:[ testing - 其他功能] ( 09.5.md )
153
- - [ 第十章 进程、线程与 goroutine] ( chapter10/10.0.md )
154
-
155
-
153
+ - 下一节:[ 总结] ( 09.7.md )
Original file line number Diff line number Diff line change
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
+
You can’t perform that action at this time.
0 commit comments