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

Function TestStatic_Kind

pkg/traceql/ast_test.go:261–296  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

259}
260
261func TestStatic_Kind(t *testing.T) {
262 tests := []struct {
263 arg any
264 ok bool
265 }{
266 // supported values
267 {arg: KindUnspecified, ok: true},
268 {arg: KindInternal, ok: true},
269 {arg: KindClient, ok: true},
270 {arg: KindServer, ok: true},
271 {arg: KindProducer, ok: true},
272 {arg: KindConsumer, ok: true},
273 // unsupported values
274 {arg: 1},
275 {arg: 3.14},
276 {arg: "test"},
277 {arg: true},
278 {arg: StatusOk},
279 {arg: []int{1, 2, 3}},
280 {arg: []float64{1.0, 2.2}},
281 {arg: []bool{true, true}},
282 {arg: []string{"aa", "bb"}},
283 }
284
285 for _, tt := range tests {
286 t.Run(testName(tt.arg), func(t *testing.T) {
287 static := newStatic(tt.arg)
288 k, ok := static.Kind()
289
290 require.Equal(t, tt.ok, ok)
291 if tt.ok {
292 assert.Equal(t, tt.arg, k)
293 }
294 })
295 }
296}
297
298func TestStatic_IntArray(t *testing.T) {
299 tests := []struct {

Callers

nothing calls this directly

Calls 5

testNameFunction · 0.85
newStaticFunction · 0.85
KindMethod · 0.80
RunMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected