X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=pe_test.go;h=7e52783ef9be9d5d92ebc37c3578884d7746081e;hb=54f890f142995fbc2ed737b8fff1635a8226ccc3;hp=5d447f4131a81e92a4709db8c89b6ad01f9b4377;hpb=8c5300370a9311b9b5296854b04c69eaee135d00;p=path-extractor.git diff --git a/pe_test.go b/pe_test.go index 5d447f4..7e52783 100644 --- a/pe_test.go +++ b/pe_test.go @@ -103,16 +103,6 @@ func TestEverything(t *testing.T) { } output = GetAllMatches("and/or", MatchOptions{}) - if len(output) != 0 { - t.Errorf("Matches and/or", output[0]) - } - - output = GetAllMatches("hello user.test.js", MatchOptions{}) - if output[0] != "user.test.js" { - t.Errorf("Matches date", output[0]) - } - - output = GetAllMatches(" mail@mail.com ", MatchOptions{}) if len(output) != 0 { t.Errorf("Matches and/or adresses", output) } @@ -122,6 +112,11 @@ func TestEverything(t *testing.T) { t.Errorf("Matches version number", output) } + output = GetAllMatches("~/v1.2/js", MatchOptions{}) + if len(output) != 1 { + t.Errorf("Should match path with version inside", output) + } + output = GetAllMatches("obj.slice()", MatchOptions{}) if len(output) != 0 { t.Errorf("Matches function call", output) @@ -184,10 +179,11 @@ func TestEverything(t *testing.T) { if len(output) != 1 { t.Errorf("Ackmate doesnt match", output) } + if output[0] == "test.js" { t.Errorf("Ackmate should not forget number", output) } - if output[0] != "test.js:45" { + if output[0] != "test.js:45:1" { t.Errorf("Ackmate should output right line number", output) } }