diff --git a/cli/util_test.go b/cli/util_test.go new file mode 100644 index 0000000000..d2f3612e67 --- /dev/null +++ b/cli/util_test.go @@ -0,0 +1,14 @@ +package cli + +import ( + "github.com/stretchr/testify/require" + "testing" +) + +func TestParseMatchers(t *testing.T) { + // Should not be able to parse lists of matchers using PromQL syntax. + // If you want to do use, should put all matchers in a single string. + m, err := parseMatchers([]string{"{foo=bar}"}) + require.EqualError(t, err, "bad matcher format: {foo=bar}") + require.Len(t, m, 0) +}