MCPcopy Create free account
hub / github.com/PostHog/duckgres / TestTypesBinary

Function TestTypesBinary

tests/integration/types_test.go:154–170  ·  view source on GitHub ↗

TestTypesBinary tests binary type handling

(t *testing.T)

Source from the content-addressed store, hash-verified

152 }
153 runQueryTests(t, tests)
154}
155
156// TestTypesBinary tests binary type handling
157func 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}

Callers

nothing calls this directly

Calls 1

runQueryTestsFunction · 0.85

Tested by

no test coverage detected