Add more unit tests.

This commit is contained in:
go-jet 2019-09-20 19:13:30 +02:00
parent 50bda95da2
commit 74b94f0d8b
3 changed files with 161 additions and 1 deletions

View file

@ -1,6 +1,7 @@
package utils
import (
"fmt"
"gotest.tools/assert"
"testing"
)
@ -23,3 +24,15 @@ func TestToGoIdentifier(t *testing.T) {
assert.Equal(t, ToGoIdentifier("My Table"), "MyTable")
assert.Equal(t, ToGoIdentifier("My-Table"), "MyTable")
}
func TestErrorCatch(t *testing.T) {
var err error
func() {
defer ErrorCatch(&err)
panic(fmt.Errorf("newError"))
}()
assert.Error(t, err, "newError")
}