5 func TestEverything(t *testing.T) {
6 output := GetAllMatches("?? alt/generateStore.php", MatchOptions{})
7 if output[0] != "alt/generateStore.php" {
8 t.Errorf("Doesnt match files", output)
11 output = GetAllMatches("I have a cat.", MatchOptions{})
13 t.Errorf("Matches sentence", output)
16 output = GetAllMatches("hello .gitignore", MatchOptions{})
17 if output[0] != ".gitignore" {
18 t.Errorf("Doesnt match hidden files", output)
21 output = GetAllMatches(" this.user ", MatchOptions{})
23 t.Errorf("Matches this.user", output)
26 output = GetAllMatches(" mail@mail.com ", MatchOptions{})
28 t.Errorf("Matches email adresses", output)
31 output = GetAllMatches(" logo@2x.png ", MatchOptions{})
33 t.Errorf("Doesn't match retina asset", output)
36 output = GetAllMatches("and/or", MatchOptions{})
38 t.Errorf("Matches and/or adresses", output)
41 output = GetAllMatches("v1.2", MatchOptions{})
43 t.Errorf("Matches version number", output)
46 output = GetAllMatches("obj.slice()", MatchOptions{})
48 t.Errorf("Matches function call", output)
51 output = GetAllMatches("~/www", MatchOptions{})
52 if len(output) == 0 || output[0] != "~/www" {
53 t.Errorf("Doesnt match home", output)
56 output = GetAllMatches("origin/master", MatchOptions{})
58 t.Errorf("Matches remote name", output)
61 output = GetAllMatches("john doe (dead on 28/04/2014)", MatchOptions{})
63 t.Errorf("Matches date", output)
66 output = GetAllMatches("john doe ,dead on 28/04/2014", MatchOptions{})
68 t.Errorf("Matches date", output)
71 output = GetAllMatches(".gitignore , ~/www", MatchOptions{})
73 t.Errorf("Doesnt match multi", output)
76 output = GetAllMatches("user.test.js", MatchOptions{})
78 t.Errorf("Doesnt match multiple extensions", output)
81 output = GetAllMatches("(user.js)", MatchOptions{})
83 t.Errorf("Doesnt match surrounded by parens", output)
85 if output[0] != "user.js" {
86 t.Errorf("matches surrounded by parens badly", output)
89 output = GetAllMatches("var/", MatchOptions{})
91 t.Errorf("Doesnt match dir", output)
94 output = GetAllMatches("//", MatchOptions{})
96 t.Errorf("Comment matches", output)
99 output = GetAllMatches("test.js:45", MatchOptions{format: "ackmate"})
100 if len(output) != 1 {
101 t.Errorf("Ackmate doesnt match", output)
103 if output[0] == "test.js" {
104 t.Errorf("Ackmate should not forget number", output)
106 if output[0] != "test.js:45" {
107 t.Errorf("Ackmate should output right line number", output)