Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions assert.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ func PanicMatchesSkip(t *testing.T, skip int, fn func(), matches string) {
fmt.Printf("%s:%d Panic... expected [%s] received [%s]", path.Base(file), line, matches, err)
t.FailNow()
}
} else {
fmt.Printf("Panic expected, none found, expected [%v] ", matches)
t.FailNow()
}
}()

Expand Down
5 changes: 5 additions & 0 deletions assert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ func TestBasicAllGood(t *testing.T) {
PanicMatches(t, func() { fn() }, "omg omg omg!")
PanicMatches(t, func() { panic("omg omg omg!") }, "omg omg omg!")

/* if you uncomment creates hard fail, that is expected
// you cant really do this, but it is here for the sake of completeness
fun := func() {}
PanicMatches(t, func() { fun() }, "omg omg omg!")
*/
errs := map[string]string{}
errs["Name"] = "User Name Invalid"
errs["Email"] = "User Email Invalid"
Expand Down