add more error tests for string.filter

This commit is contained in:
Joel Wetzell
2026-02-08 21:49:30 -06:00
parent 3688510ded
commit b53494fddc

View File

@@ -136,6 +136,22 @@ func TestBadStringFilter(t *testing.T) {
},
errorString: "string.filter processor only accepts a string",
},
{
name: "non-string pattern param",
payload: "hello",
params: map[string]any{
"pattern": 123,
},
errorString: "string.filter pattern must be a string",
},
{
name: "invalid regex pattern",
payload: "hello",
params: map[string]any{
"pattern": "*invalid",
},
errorString: "error parsing regexp: missing argument to repetition operator: `*`",
},
}
for _, test := range tests {