Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
electron0zero committed Aug 21, 2024
1 parent 15c1765 commit fb44fb9
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions pkg/traceql/ast_execute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1951,6 +1951,34 @@ func TestSpansetExistence(t *testing.T) {
},
matches: true,
},
// .foo exists but flip the query - test symmetric
{
query: `{ nil != .duration }`,
span: &mockSpan{
attributes: map[Attribute]Static{
NewAttribute("duration"): NewStaticDuration(time.Minute),
},
},
matches: true,
},
{
query: `{ nil != .bar }`,
span: &mockSpan{
attributes: map[Attribute]Static{
NewAttribute("bar"): NewStaticString("bzz"),
},
},
matches: true,
},
{
query: `{ nil != .float }`,
span: &mockSpan{
attributes: map[Attribute]Static{
NewAttribute("float"): NewStaticFloat(2.0),
},
},
matches: true,
},
}
for _, tt := range tests {
// create a evalTC and use testEvaluator
Expand Down

0 comments on commit fb44fb9

Please sign in to comment.