Gets formatting correct for tricky ingoing string

...but broken for outgoing string; must fix next
pull/210/head
Manni Wood 2016-11-13 18:08:36 -05:00
parent 9b8e3043ba
commit 4ba4d0097a
1 changed files with 4 additions and 1 deletions

View File

@ -645,7 +645,7 @@ func TestNullX(t *testing.T) {
func assertAclItemSlicesEqual(t *testing.T, query, scan []pgx.AclItem) {
if !reflect.DeepEqual(query, scan) {
t.Errorf("failed to encode aclitem[]\n EXPECTED: %v\n ACTUAL: %v", query, scan)
t.Errorf("failed to encode aclitem[]\n EXPECTED: %d %v\n ACTUAL: %d %v", len(query), query, len(scan), scan)
}
}
@ -671,6 +671,9 @@ func TestAclArrayDecoding(t *testing.T) {
{
[]pgx.AclItem{"=r/postgres", "postgres=arwdDxt/postgres"},
},
{
[]pgx.AclItem{"=r/postgres", "postgres=arwdDxt/postgres", `postgres=arwdDxt/\" tricky\, ' \} \"\" \\ test user \"`},
},
}
for i, tt := range tests {
err := conn.QueryRow(sql, tt.query).Scan(&scan)