Add more unit tests.

This commit is contained in:
go-jet 2019-09-20 19:24:54 +02:00
parent 74b94f0d8b
commit 65e05021bc
3 changed files with 43 additions and 32 deletions

View file

@ -25,7 +25,7 @@ func TestToGoIdentifier(t *testing.T) {
assert.Equal(t, ToGoIdentifier("My-Table"), "MyTable")
}
func TestErrorCatch(t *testing.T) {
func TestErrorCatchErr(t *testing.T) {
var err error
func() {
@ -36,3 +36,15 @@ func TestErrorCatch(t *testing.T) {
assert.Error(t, err, "newError")
}
func TestErrorCatchNonErr(t *testing.T) {
var err error
func() {
defer ErrorCatch(&err)
panic(11)
}()
assert.Error(t, err, "11")
}