You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

20 lines
409 B

package pnet
import (
"errors"
"testing"
)
func TestIsPnetErr(t *testing.T) {
err := NewError("test")
if err.Error() != "privnet: test" {
t.Fatalf("expected 'privnet: test' got '%s'", err.Error())
}
if !IsPNetError(err) {
t.Fatal("expected the pnetErr to be detected by IsPnetError")
}
if IsPNetError(errors.New("not pnet error")) {
t.Fatal("expected generic error not to be pnetError")
}
}