MCPcopy
hub / github.com/grafana/tempo / TestPqValueConversion

Function TestPqValueConversion

pkg/parquetquery/intern/intern_test.go:94–110  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

92}
93
94func TestPqValueConversion(t *testing.T) {
95 value := pq.ByteArrayValue([]byte("foo"))
96 pqValue := *(*pqValue)(unsafe.Pointer(&value))
97 back := *(*pq.Value)(unsafe.Pointer(&pqValue))
98
99 if value.Kind() != back.Kind() {
100 t.Error("expected same kind")
101 }
102
103 if string(value.ByteArray()) != string(back.ByteArray()) {
104 t.Error("expected same value")
105 }
106
107 if value.String() != back.String() {
108 t.Error("expected same value")
109 }
110}
111
112func BenchmarkIntern(b *testing.B) {
113 words := []string{"foo", "bar", "baz", "qux", "quux", "corge", "grault", "garply", "waldo", "fred", "plugh", "xyzzy", "thud"}

Callers

nothing calls this directly

Calls 3

KindMethod · 0.80
ErrorMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected