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