Skip to content

Commit

Permalink
test(alchemy): add new case
Browse files Browse the repository at this point in the history
  • Loading branch information
rgmz committed Oct 9, 2024
1 parent 48edfa3 commit 58df17e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/detectors/alchemy/alchemy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 58df17e

Please sign in to comment.