1. 首页
  2. 考试认证
  3. 其它
  4. assert 用go、junit风格编写的测试断言

assert 用go、junit风格编写的测试断言

上传者: 2024-09-09 03:19:32上传 ZIP文件 3.5KB 热度 3次
断言用go、junit风格编写的测试断言。用法示例: func TestCats(t *testing.T) { assert := Assert(t) cat1 := &Cat{} cat2 := &Cat{} // Cat1 and Cat2 start out as identical cats (same position, etc.) assert.Equal(cat1, cat2) // But they are not the SAME cat assert.NotSame(cat1, cat2) // However, identity should hold assert.Same(cat1, cat1) // Cat1 gets bored. cat1.Jump(3) // Now they are in d
下载地址
用户评论