Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bmizerany/assert
Asserts to Go testing
https://github.com/bmizerany/assert
Last synced: 20 days ago
JSON representation
Asserts to Go testing
- Host: GitHub
- URL: https://github.com/bmizerany/assert
- Owner: bmizerany
- Created: 2010-11-24T02:05:49.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2018-06-16T14:01:51.000Z (over 6 years ago)
- Last Synced: 2024-10-29T19:59:31.318Z (about 1 month ago)
- Language: Go
- Homepage:
- Size: 31.3 KB
- Stars: 141
- Watchers: 5
- Forks: 39
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-cobol - assert - Asserts to Cobol testing (Testing / Middlewares)
README
# 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