Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PanicMatches Bug #4

Merged
merged 3 commits into from Aug 17, 2015
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions assert.go
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
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