]> Sergey Matveev's repositories - path-extractor.git/blobdiff - pe_test.go
Remove = from match
[path-extractor.git] / pe_test.go
index a2c563aabcc068f417ef299cdc5688a4f269b8f3..719be92364388d95299b419e370c626b57fdd7c7 100644 (file)
@@ -13,6 +13,29 @@ func TestEverything(t *testing.T) {
                t.Errorf("Matches sentence", output)
        }
 
+       output = GetAllMatches("prefix=/usr/bin", MatchOptions{})
+       if len(output) != 1 {
+               t.Errorf("Should match =/usr/bin", output)
+       }
+       if output[0] != "/usr/bin" {
+               t.Errorf("Doesn't match statement correctly", 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)
+       }
+
+       output = GetAllMatches("s/^//", MatchOptions{})
+       if len(output) != 0 {
+               t.Errorf("Doesn't match substitute", output)
+       }
+
        output = GetAllMatches("/usr/bin/env\\", MatchOptions{})
        if len(output) != 1 {
                t.Errorf("Doesn't match escaped", output)