MCPcopy Create free account
hub / github.com/OpenCppCoverage/OpenCppCoverage / TEST

Function TEST

FileFilterTest/PathMatcherTest.cpp:55–69  ·  view source on GitHub ↗

-------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

53
54 //-------------------------------------------------------------------------
55 TEST(PathMatcherTest, PostFixBasicMatch)
56 {
57 std::vector<std::wstring> filenames = { L"Test.txt", L"Test\\Test2.txt" };
58 auto files = ToFiles(filenames);
59 PathMatcher pathMatcher{std::move(files), boost::none };
60
61 ASSERT_EQ(filenames.at(0), Match(pathMatcher, "Test.txt"));
62 ASSERT_EQ(filenames.at(1), Match(pathMatcher, "Test\\Test\\Test2.txt"));
63 ASSERT_EQ(filenames.at(1), Match(pathMatcher, "test\\test\\test2.txt"));
64
65 ASSERT_EQ(nullptr, pathMatcher.Match("Test2\\Test2.txt"));
66 ASSERT_EQ(nullptr, pathMatcher.Match("Test2.txt"));
67 ASSERT_EQ(nullptr, pathMatcher.Match("Test3.txt"));
68 ASSERT_EQ(0, pathMatcher.GetUnmatchedPaths().size());
69 }
70
71 //-------------------------------------------------------------------------
72 TEST(PathMatcherTest, PostFixAmgigousPath)

Callers

nothing calls this directly

Calls 4

ToFilesFunction · 0.85
MatchFunction · 0.85
MatchMethod · 0.45
GetUnmatchedPathsMethod · 0.45

Tested by

no test coverage detected