Add more unit tests.
This commit is contained in:
parent
50bda95da2
commit
74b94f0d8b
3 changed files with 161 additions and 1 deletions
|
|
@ -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")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue