MCPcopy Create free account
hub / github.com/BowenFu/matchit.cpp / TEST

Function TEST

test/matchit/noRet.cpp:6–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4using namespace matchit;
5
6TEST(MatchStatement, test)
7{
8 testing::internal::CaptureStdout();
9 match(4)(
10 // clang-format off
11 pattern | or_(_ < 0, 2) = [] { std::cout << "mismatch!"; },
12 pattern | _ = [] { std::cout << "match all!"; }
13 // clang-format on
14 );
15 std::string output = testing::internal::GetCapturedStdout();
16
17 EXPECT_STREQ(output.c_str(), "match all!");
18}
19
20TEST(MatchExpreesion, Nomatch)
21{

Callers

nothing calls this directly

Calls 3

or_Function · 0.85
matchFunction · 0.50
exprFunction · 0.50

Tested by

no test coverage detected