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