Skip to content

Commit

Permalink
Add test for PromQL braces when parsing lists of matchers
Browse files Browse the repository at this point in the history
Signed-off-by: George Robinson <[email protected]>
  • Loading branch information
grobinson-grafana committed Sep 5, 2023
1 parent 87d3ee7 commit e6827e7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cli/util_test.go
Original file line number Diff line number Diff line change
@@ -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)
}

0 comments on commit e6827e7

Please sign in to comment.