(t *testing.T)
| 24 | ) |
| 25 | |
| 26 | func TestEphemeralPathMatcher(t *testing.T) { |
| 27 | ignored := []string{ |
| 28 | ".file.txt.swp", |
| 29 | "/path/file.txt~", |
| 30 | "/home/moby/proj/.idea/modules.xml", |
| 31 | ".#file.txt", |
| 32 | "#file.txt#", |
| 33 | "/dir/.file.txt.kate-swp", |
| 34 | "/go/app/1234-go-tmp-umask", |
| 35 | } |
| 36 | matcher := watch.EphemeralPathMatcher() |
| 37 | for _, p := range ignored { |
| 38 | ok, err := matcher.Matches(p) |
| 39 | assert.NilError(t, err, "Matching %s", p) |
| 40 | assert.Assert(t, ok, "Path %s should have matched", p) |
| 41 | } |
| 42 | |
| 43 | const includedPath = "normal.txt" |
| 44 | ok, err := matcher.Matches(includedPath) |
| 45 | assert.NilError(t, err, "Matching %s", includedPath) |
| 46 | assert.Assert(t, !ok, "Path %s should NOT have matched", includedPath) |
| 47 | } |
nothing calls this directly
no test coverage detected