打赏

goconvery基本使用

goconvery基本使用

(1.)项目地址

https://github.com/smartystreets/goconvery

(2.)安装

go get -u github.com/smartystreets/goconvery/convery

(3.)启动UI界面

$GOPATH/bin/goconvery

(4.)使用示例

import(
    "testing"
    . "github.com/smartystreets/goconvery/convery"
)

func TestAdd(t *testing.T) {
    Convery("Params",t,func(){
        a := 2
        b := 4

        Convery("add two number",func(){
            c := a+b

            Convery ("result assert",func(){
                So (c%2,ShouldEqual,0)
            })
        })
    })
}
posted @ 2021-04-17 20:39  苍山落暮  阅读(232)  评论(0编辑  收藏  举报