MCPcopy
hub / github.com/docker/compose / TestEphemeralPathMatcher

Function TestEphemeralPathMatcher

pkg/watch/ephemeral_test.go:26–47  ·  pkg/watch/ephemeral_test.go::TestEphemeralPathMatcher
(t *testing.T)

Source from the content-addressed store, hash-verified

24)
25
26func 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}

Callers

nothing calls this directly

Calls 2

EphemeralPathMatcherFunction · 0.92
MatchesMethod · 0.65

Tested by

no test coverage detected