Skip to content

Commit

Permalink
Update compliance tests
Browse files Browse the repository at this point in the history
This commit updates compliance tests to include openmetrics
escape sequences that are not valid in the UTF-8 matchers parser.

Signed-off-by: George Robinson <[email protected]>
  • Loading branch information
grobinson-grafana committed Oct 24, 2023
1 parent d250132 commit 2d94808
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion matchers/compliance/compliance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,24 @@ func TestCompliance(t *testing.T) {
}(),
skip: true,
},
{
input: "{foo=\\n}",
want: func() labels.Matchers {
ms := labels.Matchers{}
m, _ := labels.NewMatcher(labels.MatchEqual, "foo", "\n")
return append(ms, m)
}(),
skip: true,
},
{
input: "{foo=\\t}",
want: func() labels.Matchers {
ms := labels.Matchers{}
m, _ := labels.NewMatcher(labels.MatchEqual, "foo", "\t")
return append(ms, m)
}(),
skip: true,
},
{
input: `{foo=bar}`,
want: func() labels.Matchers {
Expand Down Expand Up @@ -386,7 +404,7 @@ func TestCompliance(t *testing.T) {
t.Fatalf("expected error but got none: %v", tc.err)
}
if !reflect.DeepEqual(got, tc.want) {
t.Fatalf("labels not equal:\ngot %#v\nwant %#v", got, tc.want)
t.Fatalf("matchers not equal:\ngot %s\nwant %s", got, tc.want)
}
})
}
Expand Down

0 comments on commit 2d94808

Please sign in to comment.