企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# 引用 (1)引用go的标准包:testing (2)引用第三方的assert包 ~~~ import ( "testing" "github.com/stretchr/testify/assert" ) ~~~ # 例子 ![](https://img.kancloud.cn/e1/39/e1390801142ba1e6673246602fd01b19_1587x907.png) 测试函数: ~~~ funcTestNewMerkleTree(t *testing.T) ~~~ 断言: ~~~ assert.Equal(t, rootHash, fmt.Sprintf("%x", mTree.RootNode.Data), "Merkle tree root hash is correct") ~~~ # 其他断言 ~~~ NotEqual ~~~ ~~~ Nil ~~~ ~~~ NotNil ~~~