some barebones tests

This commit is contained in:
zricethezav committed 2018-02-28 23:25:04 -06:00
1 parent 0d75136c1c
commit 25736d115f
3 files changed
+3 -4

No files matched your search

+2 -2
View File
@@ -6,7 +6,7 @@ import (
func TestCheckRegex(t *testing.T) { func TestCheckRegex(t *testing.T) {
var results []Leak var results []Leak
opts := &Options{ opts = &Options{
Concurrency: 10, Concurrency: 10,
B64EntropyCutoff: 70, B64EntropyCutoff: 70,
HexEntropyCutoff: 40, HexEntropyCutoff: 40,
@@ -22,7 +22,7 @@ func TestCheckRegex(t *testing.T) {
} }
for k, v := range checks { for k, v := range checks {
results = doChecks(k, commit, opts, repo) results = doChecks(k, commit, &repo)
if v != len(results) { if v != len(results) {
t.Errorf("regexCheck failed on string %s", k) t.Errorf("regexCheck failed on string %s", k)
} }
+1 -1
View File
@@ -317,6 +317,6 @@ func (opts *Options) setupLogger() {
// isGithubTarget checks if url is a valid github target // isGithubTarget checks if url is a valid github target
func isGithubTarget(url string) bool { func isGithubTarget(url string) bool {
re := regexp.MustCompile("github\\.com\\/") re := regexp.MustCompile("github.com")
return re.MatchString(url) return re.MatchString(url)
} }
-1
View File
@@ -228,7 +228,6 @@ func reportAggregator(gitLeakReceiverWG *sync.WaitGroup, gitLeaks chan Leak, lea
} }
fmt.Println(string(b)) fmt.Println(string(b))
} }
gitLeakReceiverWG.Done() gitLeakReceiverWG.Done()
} }
} }