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

Function TestGroupCoalesceErrors

pkg/traceql/parse_test.go:490–507  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

488}
489
490func TestGroupCoalesceErrors(t *testing.T) {
491 tests := []struct {
492 in string
493 err error
494 }{
495 {in: "by(.a) && { .b }", err: newParseError("syntax error: unexpected &&, expecting with", 0, 8)},
496 {in: "by()", err: newParseError("syntax error: unexpected )", 1, 4)},
497 {in: "coalesce()", err: newParseError("syntax error: unexpected coalesce", 1, 1)},
498 }
499
500 for _, tc := range tests {
501 t.Run(tc.in, func(t *testing.T) {
502 _, err := Parse(tc.in)
503
504 require.Equal(t, tc.err, err)
505 })
506 }
507}
508
509func TestGroupCoalesceOperation(t *testing.T) {
510 tests := []struct {

Callers

nothing calls this directly

Calls 4

newParseErrorFunction · 0.85
ParseFunction · 0.85
RunMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected