Go BDD 开发
2022年1月18日项目网站
https://github.com/smartystreets/goconvey
安装
go get github.com/smartystreets/goconvey
启动web ui
$GOPATH/bin/goconvey
案例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
package testing import ( . "github.com/smartystreets/goconvey/convey" "testing" ) func TestSpec(t *testing.T) { Convey("给定2个偶数", t, func() { a := 2 b := 4 Convey("把这两个数字加起来", func() { c := a + b Convey("实结果相等", func() { So(c, ShouldEqual, 6) }) }) }) } |
pdd运行结果