Asserts to Go testing
Go
Switch branches/tags
Nothing to show
Latest commit b7ed37b Jun 12, 2016 @bmizerany committed on GitHub maintain no more.
Permalink
Failed to load latest commit information.
example remove Makefiles Jan 31, 2012
.gitignore init commit Nov 24, 2010
README.md maintain no more. Jun 11, 2016
assert.go github.com/kr/pretty.go has been renamed to github.com/kr/pretty Mar 20, 2012
assert_test.go init commit Nov 24, 2010

README.md

NO LONGER MAINTAINED - Just use Go's testing package.

Assert (c) Blake Mizerany and Keith Rarick -- MIT LICENCE

Assertions for Go tests

Install

$ go get github.com/bmizerany/assert

Use

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

Docs

http://github.com/bmizerany/assert