From 09c17b175133a883bbf3f1d292c1c579e1482c97 Mon Sep 17 00:00:00 2001 From: michalbil <92343355+michalbil@users.noreply.github.com> Date: Wed, 6 Nov 2024 14:16:56 +0100 Subject: [PATCH] fix(assets/pango/filtering): Update tests for empty filter case (#184) --- assets/pango/filtering/parse_test.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/assets/pango/filtering/parse_test.go b/assets/pango/filtering/parse_test.go index 0e388648..426bd5bf 100644 --- a/assets/pango/filtering/parse_test.go +++ b/assets/pango/filtering/parse_test.go @@ -932,7 +932,6 @@ func TestParseReturnsError(t *testing.T) { "foobar", "(", ")", - "", } for _, s := range checks { @@ -942,6 +941,15 @@ func TestParseReturnsError(t *testing.T) { } } +func TestParseEmptyString(t *testing.T) { + resp, err := Parse("", `"`) + if err != nil { + t.Fatalf("parse empty string error: %s", err) + } else if resp != nil { + t.Fatalf("parse empty string has non-nil group") + } +} + func TestParseWithInvalidQuoteReturnsError(t *testing.T) { quotes := []string{ "|",