Skip to content

Commit

Permalink
Merge pull request #4 from bluesuncorp/v1
Browse files Browse the repository at this point in the history
Fix PanicMatches Bug
  • Loading branch information
deankarn committed Aug 17, 2015
2 parents 20603e5 + f1e668e commit 6660f81
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
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

0 comments on commit 6660f81

Please sign in to comment.