MCPcopy Index your code
hub / github.com/lib/pq / TestEncodeBytea

Function TestEncodeBytea

encode_test.go:321–329  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

319}
320
321func TestEncodeBytea(t *testing.T) {
322 have, err := encode([]byte("\\x\x00\x01\x02\xFF\xFEabcdefg0123"), oid.T_bytea)
323 if err != nil {
324 t.Fatal(err)
325 }
326 if want := []byte("\\x5c78000102fffe6162636465666730313233"); !bytes.Equal(want, have) {
327 t.Errorf("\nhave: %v\nwant: %v", have, want)
328 }
329}
330
331func TestByteaOutputFormats(t *testing.T) {
332 t.Parallel()

Callers

nothing calls this directly

Calls 2

encodeFunction · 0.85
FatalMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…