Skip to content

Find, verify, and analyze leaked credentials

Add ShannonEntropy test for an empty string (#1893)

Miccahd4d4d0ec9a23
diff --git a/pkg/detectors/falsepositives_test.go b/pkg/detectors/falsepositives_test.go
index 1a5a5b9e5..b84aa427d 100644
--- a/pkg/detectors/falsepositives_test.go
+++ b/pkg/detectors/falsepositives_test.go
@@ -74,6 +74,13 @@ func TestStringShannonEntropy(t *testing.T) {
},
want: 0.22228483068568816,
},
+ {
+ name: "empty",
+ args: args{
+ input: "",
+ },
+ want: 0.0,
+ },
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {