]> Sergey Matveev's repositories - path-extractor.git/blobdiff - pe_test.go
More matches (with _)
[path-extractor.git] / pe_test.go
index 28f87f7afb3ddfb231e751b018861b1234057654..2deeae75e91b5c61daf315ccba39ec9106ee0ba6 100644 (file)
@@ -13,6 +13,44 @@ func TestEverything(t *testing.T) {
                t.Errorf("Matches sentence", output)
        }
 
+       output = GetAllMatches("'/usr/bin", MatchOptions{})
+       if output[0] != "/usr/bin" {
+               t.Errorf("Doesn't match statement correctly", output)
+       }
+
+       output = GetAllMatches("/usr_b/bin", MatchOptions{})
+       if output[0] != "/usr_b/bin" {
+               t.Errorf("Doesn't match statement correctly", output)
+       }
+
+       output = GetAllMatches("\"/usr/bin", MatchOptions{})
+       if output[0] != "/usr/bin" {
+               t.Errorf("Doesn't match statement correctly", output)
+       }
+
+       output = GetAllMatches("`/usr/bin", MatchOptions{})
+       if output[0] != "/usr/bin" {
+               t.Errorf("Doesn't match statement correctly", output)
+       }
+
+       output = GetAllMatches("€/usr/bin", MatchOptions{})
+       if output[0] != "/usr/bin" {
+               t.Errorf("Doesn't match statement correctly", 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)
@@ -49,6 +87,11 @@ func TestEverything(t *testing.T) {
                t.Errorf("Matches this.user", output)
        }
 
+       output = GetAllMatches("To https://test@test.org/88/ls.git", MatchOptions{})
+       if len(output) != 0 {
+               t.Errorf("Matches email adresses", output)
+       }
+
        output = GetAllMatches(" mail@mail.com ", MatchOptions{})
        if len(output) != 0 {
                t.Errorf("Matches email adresses", output)