Skip to content

Latest commit

 

History

History
21 lines (20 loc) · 648 Bytes

README.md

File metadata and controls

21 lines (20 loc) · 648 Bytes

assertion

go assertion without testing.

why I need it

I just want to find a tool that could make me write go assertions like:

assertion.Equals(expected, actual)
assertion.NotNull(actual)

instead of:

if expected != actual {
  panic("xxxxx")
}

but I cannot find a satisfied one. stretchr/testify is good but its code like:

assert.Equal(t, 123, 123, "they should be equal")

I don't write assertion code in testing so I have not parameter t with is tesing.T. I just think: "Why not I write a new tesing lib? I didn't want any powerful functions, I just wan't write too many if...panic..." ... and here it is.