diff --git a/filters/filter_test.go b/filters/filter_test.go index 46c7d55e7..f7065822a 100644 --- a/filters/filter_test.go +++ b/filters/filter_test.go @@ -317,3 +317,20 @@ func TestFilters(t *testing.T) { }) } } + +func TestOperatorStrings(t *testing.T) { + for _, testcase := range []struct { + op operator + expected string + }{ + {operatorPresent, "?"}, + {operatorEqual, "=="}, + {operatorNotEqual, "!="}, + {operatorMatches, "~="}, + {10, "unknown"}, + } { + if !reflect.DeepEqual(testcase.op.String(), testcase.expected) { + t.Fatalf("return value unexpected: %v != %v", testcase.op.String(), testcase.expected) + } + } +}