[progress] stricter regex, tests

This commit is contained in:
zricethezav committed 2018-01-28 13:16:46 -05:00
1 parent 595da56eef
commit ec654441bb
3 files changed
+44 -21

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
package main
import (
"testing"
)
func TestCheckRegex(t *testing.T) {
var secretsPresent bool
checks := map[string]bool{
"github.com": false,
"github.com/user/": false,
"github_api_client = \"sample key\"": true,
}
for k, v := range checks {
_, secretsPresent = checkRegex(k)
if v != secretsPresent {
t.Errorf("regexCheck failed on string %s. Expected secretsPresent: %t, got %t", k, v, secretsPresent)
}
}
}