]> Sergey Matveev's repositories - path-extractor.git/blobdiff - pe_test.go
Shouldn't match + nor ^
[path-extractor.git] / pe_test.go
index bfcd26a47bf94b880e9c43957134da083d63fc3d..28f87f7afb3ddfb231e751b018861b1234057654 100644 (file)
@@ -13,6 +13,24 @@ func TestEverything(t *testing.T) {
                t.Errorf("Matches sentence", 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)
+       }
+       if output[0] != "/usr/bin/env" {
+               t.Errorf("Doesn't match escaped exactly", output)
+       }
+
        output = GetAllMatches("!#/usr/bin/env", MatchOptions{})
        if len(output) != 1 {
                t.Errorf("Doesn't match shebang", output)