Browse Source

Add test for ErrNo.Extend()

mattn 4 years ago
parent
commit
a528a30852
1 changed files with 6 additions and 0 deletions
  1. 6 0
      error_test.go

+ 6 - 0
error_test.go

@@ -231,6 +231,12 @@ func TestExtendedErrorCodes_Unique(t *testing.T) {
 			t.Errorf("Wrong extended error code: %d != %d",
 				sqliteErr.ExtendedCode, ErrConstraintUnique)
 		}
+		extended := sqliteErr.Code.Extend(3).Error()
+		expected := "constraint failed"
+		if extended != expected {
+			t.Errorf("Wrong basic error code: %q != %q",
+				extended, expected)
+		}
 	}
 
 }