Improve test coverage for matching paths
This commit is contained in:
parent
d858bfc338
commit
25deb996e9
|
@ -48,6 +48,7 @@ private:
|
|||
TEST_CASE(onemasksamepath);
|
||||
TEST_CASE(onemasksamepathdifferentcase);
|
||||
TEST_CASE(onemasksamepathwithfile);
|
||||
TEST_CASE(onemaskshorterpath);
|
||||
TEST_CASE(onemaskdifferentdir1);
|
||||
TEST_CASE(onemaskdifferentdir2);
|
||||
TEST_CASE(onemaskdifferentdir3);
|
||||
|
@ -105,6 +106,15 @@ private:
|
|||
ASSERT(srcMatcher.match("src/file.txt"));
|
||||
}
|
||||
|
||||
void onemaskshorterpath() const {
|
||||
const std::string longerExclude("longersrc/");
|
||||
const std::string shorterToMatch("src/");
|
||||
ASSERT(shorterToMatch.length() < longerExclude.length());
|
||||
PathMatch match(std::vector<std::string>(1, longerExclude));
|
||||
ASSERT(match.match(longerExclude));
|
||||
ASSERT(!match.match(shorterToMatch));
|
||||
}
|
||||
|
||||
void onemaskdifferentdir1() const {
|
||||
ASSERT(!srcMatcher.match("srcfiles/file.txt"));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue