fixup! test(api): add basic tests for generateJSON()
This commit is contained in:
parent
7500d04c65
commit
659ce3064b
1 changed files with 2 additions and 2 deletions
|
@ -7,7 +7,7 @@ import (
|
||||||
func TestInvalidIP(t *testing.T) {
|
func TestInvalidIP(t *testing.T) {
|
||||||
_, err := generateJSON("foo")
|
_, err := generateJSON("foo")
|
||||||
errwant := "invalid IP"
|
errwant := "invalid IP"
|
||||||
if err.Error() != errwant {
|
if err == nil || err.Error() != errwant {
|
||||||
t.Fatalf(`generateJSON("foo") == "%v", wants "%s"`, err, errwant)
|
t.Fatalf(`generateJSON("foo") == "%v", wants "%s"`, err, errwant)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ func TestInvalidIP(t *testing.T) {
|
||||||
func TestInaccessibleIP(t *testing.T) {
|
func TestInaccessibleIP(t *testing.T) {
|
||||||
_, err := generateJSON("0.0.0.0")
|
_, err := generateJSON("0.0.0.0")
|
||||||
errwant := "unspecified IP"
|
errwant := "unspecified IP"
|
||||||
if err.Error() != errwant {
|
if err == nil || err.Error() != errwant {
|
||||||
t.Fatalf(`generateJSON("0.0.0.0") == "%v", wants "%s"`, err, errwant)
|
t.Fatalf(`generateJSON("0.0.0.0") == "%v", wants "%s"`, err, errwant)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue