mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-27 05:15:47 +00:00
add more error tests for string.filter
This commit is contained in:
@@ -136,6 +136,22 @@ func TestBadStringFilter(t *testing.T) {
|
|||||||
},
|
},
|
||||||
errorString: "string.filter processor only accepts a string",
|
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 {
|
for _, test := range tests {
|
||||||
|
|||||||
Reference in New Issue
Block a user