go-utils/common/checkErr_test.go

22 lines
264 B
Go
Raw Normal View History

2021-08-11 12:27:54 +00:00
package common
import (
"errors"
"testing"
)
func TestCheckErrTrue(T *testing.T) {
2021-08-14 20:44:09 +00:00
// true
2021-08-11 12:27:54 +00:00
err := errors.New("Test")
e := CheckErr(err, "test err")
if e != true {
T.Error(e)
}
2021-08-14 20:44:09 +00:00
// false
e = CheckErr(nil, "test err")
2021-08-11 12:27:54 +00:00
if e != false {
T.Error(e)
}
}