Add test for ErrNo.Extend()

This commit is contained in:
mattn 2015-01-26 18:36:21 +09:00
parent 9c64e666d6
commit a528a30852
1 changed files with 6 additions and 0 deletions

View File

@ -231,6 +231,12 @@ func TestExtendedErrorCodes_Unique(t *testing.T) {
t.Errorf("Wrong extended error code: %d != %d", t.Errorf("Wrong extended error code: %d != %d",
sqliteErr.ExtendedCode, ErrConstraintUnique) 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)
}
} }
} }