From b53494fddc14af38e8c220d46c33bd6bd60a5328 Mon Sep 17 00:00:00 2001 From: Joel Wetzell Date: Sun, 8 Feb 2026 21:49:30 -0600 Subject: [PATCH] add more error tests for string.filter --- internal/processor/string-filter_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/internal/processor/string-filter_test.go b/internal/processor/string-filter_test.go index 74ca30e..1de2e99 100644 --- a/internal/processor/string-filter_test.go +++ b/internal/processor/string-filter_test.go @@ -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 {