TestTypesBinary tests binary type handling
(t *testing.T)
| 152 | } |
| 153 | runQueryTests(t, tests) |
| 154 | } |
| 155 | |
| 156 | // TestTypesBinary tests binary type handling |
| 157 | func TestTypesBinary(t *testing.T) { |
| 158 | tests := []QueryTest{ |
| 159 | // Bytea literals |
| 160 | {Name: "bytea_hex", Query: "SELECT '\\x48656c6c6f'::BYTEA"}, |
| 161 | {Name: "bytea_escape", Query: "SELECT '\\000\\001\\002'::BYTEA", Skip: SkipDifferentBehavior}, |
| 162 | |
| 163 | // Encode/decode |
| 164 | {Name: "decode_hex", Query: "SELECT decode('48656c6c6f', 'hex')"}, |
| 165 | {Name: "encode_hex", Query: "SELECT encode('hello'::BYTEA, 'hex')"}, |
| 166 | {Name: "encode_base64", Query: "SELECT encode('hello'::BYTEA, 'base64')"}, |
| 167 | {Name: "decode_base64", Query: "SELECT decode('aGVsbG8=', 'base64')"}, |
| 168 | |
| 169 | // From table |
| 170 | {Name: "select_bytea_column", Query: "SELECT bytea_col FROM types_test WHERE id = 1"}, |
| 171 | } |
| 172 | runQueryTests(t, tests) |
| 173 | } |
nothing calls this directly
no test coverage detected