From 58df17ed7a4030e6d6690db7daa1db5687ff3a85 Mon Sep 17 00:00:00 2001 From: Richard Gomez Date: Wed, 9 Oct 2024 09:21:42 -0400 Subject: [PATCH] test(alchemy): add new case --- pkg/detectors/alchemy/alchemy_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkg/detectors/alchemy/alchemy_test.go b/pkg/detectors/alchemy/alchemy_test.go index 3462a475b1d5..83af610b3f4e 100644 --- a/pkg/detectors/alchemy/alchemy_test.go +++ b/pkg/detectors/alchemy/alchemy_test.go @@ -21,6 +21,17 @@ func TestAlchemy_Pattern(t *testing.T) { input: "alchemy_token = '3aBcDFE5678901234567890_1a2b3c4d'", want: []string{"3aBcDFE5678901234567890_1a2b3c4d"}, }, + { + name: "finds all matches", + input: `alchemy_token1 = '3aBcDFE5678901234567890_1a2b3c4d' +alchemy_token2 = '3aDcDFE56789012245678a0_1a2b3c2d'`, + want: []string{"3aBcDFE5678901234567890_1a2b3c4d", "3aDcDFE56789012245678a0_1a2b3c2d"}, + }, + { + name: "invald pattern", + input: "alchemy_token = '1a2b3c4d'", + want: []string{}, + }, } for _, test := range tests {