aboutsummaryrefslogtreecommitdiff
path: root/error_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'error_test.go')
-rw-r--r--error_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/error_test.go b/error_test.go
index e21f215..1ccbe5b 100644
--- a/error_test.go
+++ b/error_test.go
@@ -1,3 +1,8 @@
+// Copyright (C) 2014 Yasuhiro Matsumoto <mattn.jp@gmail.com>.
+//
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file.
+
package sqlite3
import (
@@ -226,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)
+ }
}
}