Skip to content

technosophos/assert

 
 

Repository files navigation

assert

Build Status GoDoc Go Report Card

assert is Go package that provides convenience methods for writing assertions in standard Go tests.

You can write this test with assert:

func TestSomething(t *testing.T) {
  i, err := doSomething()
  assert.NoErr(t, err)
  assert.Equal(t, i, 123, "returned integer")
}

Instead of writing this test with only the standard testing library:

func TestSomething(t *testing.T) {
  i, err := doSomething()
  if err != nil {
    t.Fatalf("error encountered: %s", err)
  }
  if i != 123 {
    t.Fatalf("returned integer was %d, not %d", i, 123)
  }
}

About

Simple assertions for Go (golang) tests

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%