MCPcopy
hub / github.com/rclone/rclone / TestPatternMatch

Function TestPatternMatch

backend/googlephotos/pattern_test.go:72–203  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

70}
71
72func TestPatternMatch(t *testing.T) {
73 for testNumber, test := range []struct {
74 // input
75 root string
76 itemPath string
77 isFile bool
78 // expected output
79 wantMatch []string
80 wantPrefix string
81 wantPattern *dirPattern
82 }{
83 {
84 root: "",
85 itemPath: "",
86 isFile: false,
87 wantMatch: []string{""},
88 wantPrefix: "",
89 wantPattern: &patterns[0],
90 },
91 {
92 root: "",
93 itemPath: "",
94 isFile: true,
95 wantMatch: nil,
96 wantPrefix: "",
97 wantPattern: nil,
98 },
99 {
100 root: "upload",
101 itemPath: "",
102 isFile: false,
103 wantMatch: []string{"upload", ""},
104 wantPrefix: "",
105 wantPattern: &patterns[1],
106 },
107 {
108 root: "upload/dir",
109 itemPath: "",
110 isFile: false,
111 wantMatch: []string{"upload/dir", "dir"},
112 wantPrefix: "",
113 wantPattern: &patterns[1],
114 },
115 {
116 root: "upload/file.jpg",
117 itemPath: "",
118 isFile: true,
119 wantMatch: []string{"upload/file.jpg", "file.jpg"},
120 wantPrefix: "",
121 wantPattern: &patterns[2],
122 },
123 {
124 root: "media",
125 itemPath: "",
126 isFile: false,
127 wantMatch: []string{"media"},
128 wantPrefix: "",
129 wantPattern: &patterns[3],

Callers

nothing calls this directly

Calls 3

matchMethod · 0.80
RunMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…