Skip to content

Commit 515e84e

Browse files
committed
Renamed PathMatch::Match to PathMatch::match
1 parent 252fab2 commit 515e84e

File tree

2 files changed

+30
-30
lines changed

2 files changed

+30
-30
lines changed

cli/filelister.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ void FileLister::recursiveAddFiles(std::map<std::string, std::size_t> &files, co
122122

123123
if ((ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) {
124124
// File
125-
if ((!checkAllFilesInDir || Path::acceptFile(fname, extra)) && !ignored.Match(fname)) {
125+
if ((!checkAllFilesInDir || Path::acceptFile(fname, extra)) && !ignored.match(fname)) {
126126
const std::string nativename = Path::fromNativeSeparators(fname);
127127

128128
// Limitation: file sizes are assumed to fit in a 'size_t'
@@ -197,11 +197,11 @@ static void addFiles2(std::map<std::string, std::size_t> &files,
197197
new_path = path + '/' + dir_result->d_name;
198198

199199
if (dir_result->d_type == DT_DIR || (dir_result->d_type == DT_UNKNOWN && FileLister::isDirectory(new_path))) {
200-
if (recursive && !ignored.Match(new_path)) {
200+
if (recursive && !ignored.match(new_path)) {
201201
addFiles2(files, new_path, extra, recursive, ignored);
202202
}
203203
} else {
204-
if (Path::acceptFile(new_path, extra) && !ignored.Match(new_path)) {
204+
if (Path::acceptFile(new_path, extra) && !ignored.match(new_path)) {
205205
files[new_path] = file_stat.st_size;
206206
}
207207
}

test/testpathmatch.cpp

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -71,134 +71,134 @@ class TestPathMatch : public TestFixture {
7171

7272
// Test empty PathMatch
7373
void emptymaskemptyfile() const {
74-
ASSERT(!emptyMatcher.Match(""));
74+
ASSERT(!emptyMatcher.match(""));
7575
}
7676

7777
void emptymaskpath1() const {
78-
ASSERT(!emptyMatcher.Match("src/"));
78+
ASSERT(!emptyMatcher.match("src/"));
7979
}
8080

8181
void emptymaskpath2() const {
82-
ASSERT(!emptyMatcher.Match("../src/"));
82+
ASSERT(!emptyMatcher.match("../src/"));
8383
}
8484

8585
void emptymaskpath3() const {
86-
ASSERT(!emptyMatcher.Match("/home/user/code/src/"));
86+
ASSERT(!emptyMatcher.match("/home/user/code/src/"));
8787
}
8888

8989
// Test PathMatch containing "src/"
9090
void onemaskemptypath() const {
91-
ASSERT(!srcMatcher.Match(""));
91+
ASSERT(!srcMatcher.match(""));
9292
}
9393

9494
void onemasksamepath() const {
95-
ASSERT(srcMatcher.Match("src/"));
95+
ASSERT(srcMatcher.match("src/"));
9696
}
9797

9898
void onemasksamepathdifferentcase() const {
9999
std::vector<std::string> masks(1, "sRc/");
100100
PathMatch match(masks, false);
101-
ASSERT(match.Match("srC/"));
101+
ASSERT(match.match("srC/"));
102102
}
103103

104104
void onemasksamepathwithfile() const {
105-
ASSERT(srcMatcher.Match("src/file.txt"));
105+
ASSERT(srcMatcher.match("src/file.txt"));
106106
}
107107

108108
void onemaskdifferentdir1() const {
109-
ASSERT(!srcMatcher.Match("srcfiles/file.txt"));
109+
ASSERT(!srcMatcher.match("srcfiles/file.txt"));
110110
}
111111

112112
void onemaskdifferentdir2() const {
113-
ASSERT(!srcMatcher.Match("proj/srcfiles/file.txt"));
113+
ASSERT(!srcMatcher.match("proj/srcfiles/file.txt"));
114114
}
115115

116116
void onemaskdifferentdir3() const {
117-
ASSERT(!srcMatcher.Match("proj/mysrc/file.txt"));
117+
ASSERT(!srcMatcher.match("proj/mysrc/file.txt"));
118118
}
119119

120120
void onemaskdifferentdir4() const {
121-
ASSERT(!srcMatcher.Match("proj/mysrcfiles/file.txt"));
121+
ASSERT(!srcMatcher.match("proj/mysrcfiles/file.txt"));
122122
}
123123

124124
void onemasklongerpath1() const {
125-
ASSERT(srcMatcher.Match("/tmp/src/"));
125+
ASSERT(srcMatcher.match("/tmp/src/"));
126126
}
127127

128128
void onemasklongerpath2() const {
129-
ASSERT(srcMatcher.Match("src/module/"));
129+
ASSERT(srcMatcher.match("src/module/"));
130130
}
131131

132132
void onemasklongerpath3() const {
133-
ASSERT(srcMatcher.Match("project/src/module/"));
133+
ASSERT(srcMatcher.match("project/src/module/"));
134134
}
135135

136136
void twomasklongerpath1() const {
137137
std::vector<std::string> masks;
138138
masks.push_back("src/");
139139
masks.push_back("module/");
140140
PathMatch match(masks);
141-
ASSERT(!match.Match("project/"));
141+
ASSERT(!match.match("project/"));
142142
}
143143

144144
void twomasklongerpath2() const {
145145
std::vector<std::string> masks;
146146
masks.push_back("src/");
147147
masks.push_back("module/");
148148
PathMatch match(masks);
149-
ASSERT(match.Match("project/src/"));
149+
ASSERT(match.match("project/src/"));
150150
}
151151

152152
void twomasklongerpath3() const {
153153
std::vector<std::string> masks;
154154
masks.push_back("src/");
155155
masks.push_back("module/");
156156
PathMatch match(masks);
157-
ASSERT(match.Match("project/module/"));
157+
ASSERT(match.match("project/module/"));
158158
}
159159

160160
void twomasklongerpath4() const {
161161
std::vector<std::string> masks;
162162
masks.push_back("src/");
163163
masks.push_back("module/");
164164
PathMatch match(masks);
165-
ASSERT(match.Match("project/src/module/"));
165+
ASSERT(match.match("project/src/module/"));
166166
}
167167

168168
// Test PathMatch containing "foo.cpp"
169169
void filemask1() const {
170-
ASSERT(fooCppMatcher.Match("foo.cpp"));
170+
ASSERT(fooCppMatcher.match("foo.cpp"));
171171
}
172172

173173
void filemaskdifferentcase() const {
174174
std::vector<std::string> masks(1, "foo.cPp");
175175
PathMatch match(masks, false);
176-
ASSERT(match.Match("fOo.cpp"));
176+
ASSERT(match.match("fOo.cpp"));
177177
}
178178

179179
void filemask2() const {
180-
ASSERT(fooCppMatcher.Match("../foo.cpp"));
180+
ASSERT(fooCppMatcher.match("../foo.cpp"));
181181
}
182182

183183
void filemask3() const {
184-
ASSERT(fooCppMatcher.Match("src/foo.cpp"));
184+
ASSERT(fooCppMatcher.match("src/foo.cpp"));
185185
}
186186

187187
// Test PathMatch containing "src/foo.cpp"
188188
void filemaskpath1() const {
189-
ASSERT(srcFooCppMatcher.Match("src/foo.cpp"));
189+
ASSERT(srcFooCppMatcher.match("src/foo.cpp"));
190190
}
191191

192192
void filemaskpath2() const {
193-
ASSERT(srcFooCppMatcher.Match("proj/src/foo.cpp"));
193+
ASSERT(srcFooCppMatcher.match("proj/src/foo.cpp"));
194194
}
195195

196196
void filemaskpath3() const {
197-
ASSERT(!srcFooCppMatcher.Match("foo.cpp"));
197+
ASSERT(!srcFooCppMatcher.match("foo.cpp"));
198198
}
199199

200200
void filemaskpath4() const {
201-
ASSERT(!srcFooCppMatcher.Match("bar/foo.cpp"));
201+
ASSERT(!srcFooCppMatcher.match("bar/foo.cpp"));
202202
}
203203
};
204204

0 commit comments

Comments
 (0)