Improve test coverage for matching paths

This commit is contained in:
Dmitry-Me 2020-02-11 18:19:39 +03:00
parent d858bfc338
commit 25deb996e9
1 changed files with 10 additions and 0 deletions

View File

@ -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"));
}