Skip to content

Commit

Permalink
Add more test cases for extract matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
sd2k committed May 1, 2024
1 parent 7028bee commit d22cbaa
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/traceql/extractmatcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,16 @@ func TestExtractMatchers(t *testing.T) {
query: `{ .foo =~ "(a|b)" }`,
expected: `{.foo =~ "(a|b)"}`,
},
{
name: "query with multiple regex matchers",
query: `{ .foo =~ "(a|b)" && .bar =~ "(c|d)" }`,
expected: `{.foo =~ "(a|b)" && .bar =~ "(c|d)"}`,
},
{
name: "query with mixed equal and regex matchers",
query: `{ .foo = "a" && .bar =~ "(c|d)" }`,
expected: `{.foo = "a" && .bar =~ "(c|d)"}`,
},
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
Expand Down

0 comments on commit d22cbaa

Please sign in to comment.