wlf f051014ac2 提交正常运行的所有代码 | 1 year ago | |
---|---|---|
.. | ||
README.md | 1 year ago | |
assert.go | 1 year ago |
$ go get github.com/bmizerany/assert
point.go
package point
type Point struct {
x, y int
}
point_test.go
package point
import (
"testing"
"github.com/bmizerany/assert"
)
func TestAsserts(t *testing.T) {
p1 := Point{1, 1}
p2 := Point{2, 1}
assert.Equal(t, p1, p2)
}
output
$ go test
--- FAIL: TestAsserts (0.00 seconds)
assert.go:15: /Users/flavio.barbosa/dev/stewie/src/point_test.go:12
assert.go:24: ! X: 1 != 2
FAIL
http://github.com/bmizerany/assert