| 4 | using namespace matchit; |
| 5 | |
| 6 | TEST(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 | |
| 20 | TEST(MatchExpreesion, Nomatch) |
| 21 | { |