summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/lib/pq/encode_test.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-09-23 10:17:51 -0400
committerGitHub <noreply@github.com>2016-09-23 10:17:51 -0400
commit2ca0e8f9a0f9863555a26e984cde15efff9ef8f8 (patch)
treedaae1ee67b14a3d0a84424f2a304885d9e75ce2b /vendor/github.com/lib/pq/encode_test.go
parent6d62d65b2dc85855aabea036cbd44f6059e19d13 (diff)
downloadchat-2ca0e8f9a0f9863555a26e984cde15efff9ef8f8.tar.gz
chat-2ca0e8f9a0f9863555a26e984cde15efff9ef8f8.tar.bz2
chat-2ca0e8f9a0f9863555a26e984cde15efff9ef8f8.zip
Updating golang dependancies (#4075)
Diffstat (limited to 'vendor/github.com/lib/pq/encode_test.go')
-rw-r--r--vendor/github.com/lib/pq/encode_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/vendor/github.com/lib/pq/encode_test.go b/vendor/github.com/lib/pq/encode_test.go
index 984abbc94..1e89f7f6f 100644
--- a/vendor/github.com/lib/pq/encode_test.go
+++ b/vendor/github.com/lib/pq/encode_test.go
@@ -575,6 +575,17 @@ func TestBinaryByteSliceToInt(t *testing.T) {
}
}
+func TestTextDecodeIntoString(t *testing.T) {
+ input := []byte("hello world")
+ want := string(input)
+ for _, typ := range []oid.Oid{oid.T_char, oid.T_varchar, oid.T_text} {
+ got := decode(&parameterStatus{}, input, typ, formatText)
+ if got != want {
+ t.Errorf("invalid string decoding output for %T(%+v), got %v but expected %v", typ, typ, got, want)
+ }
+ }
+}
+
func TestByteaOutputFormatEncoding(t *testing.T) {
input := []byte("\\x\x00\x01\x02\xFF\xFEabcdefg0123")
want := []byte("\\x5c78000102fffe6162636465666730313233")