Validation tests

This commit is contained in:
Jae Kwon
2014-11-05 03:12:05 -08:00
parent e42771e36f
commit b7b923cc6b
10 changed files with 279 additions and 97 deletions
+14
View File
@@ -0,0 +1,14 @@
package test
import (
"testing"
)
func AssertPanics(t *testing.T, msg string, f func()) {
defer func() {
if err := recover(); err == nil {
t.Errorf("Should have panic'd, but didn't: %v", msg)
}
}()
f()
}