【文件属性】:
文件名称:expect:Go的测试框架
文件大小:18KB
文件格式:ZIP
更新时间:2021-05-18 13:08:50
Go
预计
一个可以帮助您在Go中编写测试的库。
Go的内置测试包有什么问题? 不多,除了它倾向于导致冗长的代码。 Expect在go test运行,但是提供了用于指定期望的不同语法。
例子
import (
"testing"
. "github.com/karlseguin/expect"
)
type CalculatorTests struct {}
func Test_Caculator ( t * testing. T ) {
Expectify ( new ( CalculatorTests ), t )
}
func ( _ CalculatorTests ) AddsTwoNumbers () {
c := new ( Calculator )
Expect ( c . Add ( 4 , 8 )). To . Equal ( 12 )
Expect
【文件预览】:
expect-master
----go.mod(118B)
----each_test.go(273B)
----mock()
--------conn.go(2KB)
----Makefile(35B)
----license.txt(1KB)
----build()
--------request_test.go(2KB)
--------request.go(2KB)
----comparitors.go(2KB)
----expect_test.go(6KB)
----go.sum(231B)
----runner.go(6KB)
----posthandler.go(889B)
----reflection.go(2KB)
----expect.go(9KB)
----readme.md(9KB)
----each_no_test.go(304B)
----expect_numeric_test.go(8KB)