From a528a3085290a55613949f2cd363e6fd57bf67ee Mon Sep 17 00:00:00 2001 From: mattn Date: Mon, 26 Jan 2015 18:36:21 +0900 Subject: [PATCH] Add test for ErrNo.Extend() --- error_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/error_test.go b/error_test.go index a006188..1ccbe5b 100644 --- a/error_test.go +++ b/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) + } } }