From: Edgar HIPP Date: Sun, 30 Aug 2015 15:07:10 +0000 (+0200) Subject: Shouldn't match // X-Git-Url: http://www.git.stargrave.org/?p=path-extractor.git;a=commitdiff_plain;h=73b6fdd2e1d59e3b54dbdecdf5b01efa3ba38261 Shouldn't match // --- diff --git a/pe_test.go b/pe_test.go index 28f87f7..eefbbfe 100644 --- a/pe_test.go +++ b/pe_test.go @@ -13,6 +13,11 @@ func TestEverything(t *testing.T) { t.Errorf("Matches sentence", output) } + output = GetAllMatches("/var//log", MatchOptions{}) + if len(output) != 0 { + t.Errorf("Matches double //", output) + } + output = GetAllMatches("s/+//", MatchOptions{}) if len(output) != 0 { t.Errorf("Doesn't match substitute", output) diff --git a/validators.go b/validators.go index adc8116..042862c 100644 --- a/validators.go +++ b/validators.go @@ -67,7 +67,7 @@ func endsWithInvalidString(input string) bool { } func containsInvalidString(input string) bool { - invalidStrings := []string{"()", "and/or", "origin/", "{", "}", "<", ">", "$", "*", "this."} + invalidStrings := []string{"//", "()", "and/or", "origin/", "{", "}", "<", ">", "$", "*", "this."} for _, s := range invalidStrings { if strings.Contains(input, s) { return true