From e3859aa03e9cfe5980abf3b9b33876ce6ed34baf Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Sat, 30 Apr 2016 12:43:18 -0500 Subject: [PATCH] Test should not panic if no err --- values_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/values_test.go b/values_test.go index a729dac3..91e2173f 100644 --- a/values_test.go +++ b/values_test.go @@ -196,7 +196,7 @@ func testJsonInt16ArrayFailureDueToOverflow(t *testing.T, conn *pgx.Conn, typena input := []int{1, 2, 234432} var output []int16 err := conn.QueryRow("select $1::"+typename, input).Scan(&output) - if err.Error() != "can't scan into dest[0]: json: cannot unmarshal number 234432 into Go value of type int16" { + if err == nil || err.Error() != "can't scan into dest[0]: json: cannot unmarshal number 234432 into Go value of type int16" { t.Errorf("%s: Expected *json.UnmarkalTypeError, but got %v", typename, err) } }