diff --git a/imagehash_test.go b/imagehash_test.go index 5af34e6..81f34e9 100644 --- a/imagehash_test.go +++ b/imagehash_test.go @@ -59,13 +59,13 @@ func TestNewImageHash(t *testing.T) { func TestNil(t *testing.T) { hash := NewImageHash(0, AHash) dis, err := hash.Distance(nil) - if dis != -1 { - t.Errorf("Distance is expected as %d but got %d", -1, dis) - } expectedError := errors.New("other should not be nil") if err != nil && err.Error() != expectedError.Error() { t.Errorf("Expected err %s, actual %s", expectedError, err) } + if dis != -1 { + t.Errorf("Distance is expected as %d but got %d", -1, dis) + } } func TestSerialization(t *testing.T) {