]> Sergey Matveev's repositories - path-extractor.git/commitdiff
Shouldn't match //
authorEdgar HIPP <hipp.edg@gmail.com>
Sun, 30 Aug 2015 15:07:10 +0000 (17:07 +0200)
committerEdgar HIPP <hipp.edg@gmail.com>
Sun, 30 Aug 2015 15:07:10 +0000 (17:07 +0200)
pe_test.go
validators.go

index 28f87f7afb3ddfb231e751b018861b1234057654..eefbbfe79a922799fb42f9528d9e6cbafb54b1f3 100644 (file)
@@ -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)
index adc811666613f33c9c5c9aae31f6a390f2d66170..042862c2c77c131db800d58a96e7152d50758931 100644 (file)
@@ -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