Categorygithub.com/daviddengcn/go-assert
repositorypackage
0.0.0-20150305222929-ba7e68aeeff6
Repository: https://github.com/daviddengcn/go-assert.git
Documentation: pkg.go.dev

# README

go-test GoSearch

Assert utils for GO testing.

Featured

  • LinesEqual and TextEquals Other than showing the assertion failure message, they also shows the line-to-line diff result for your information:

Example code

func TestForExample(t *testing.T) {
	TextEquals(t, "info",
`Hello world,
Pleae help me,
doing this`,
`Hello world,
please help me`)
}

Results

--- FAIL: TestForExample (0.00 seconds)
	assert.go:123: assert.go:172: Unexpected info: exp 2, act 3 lines
	assert.go:124: Difference(exp ===  act ### change --- +++)
	assert.go:147: ---   2: please help me.
	assert.go:148: +++   2: Pleae help me,.
	assert.go:143: ###   3: doing this.

License

BSD license.