leetcode/tests/s0010_regular_expression_matching.cpp

25 lines
438 B
C++
Raw Normal View History

2022-11-03 06:57:32 +00:00
#include "s0010_regular_expression_matching.hpp"
#include <gtest/gtest.h>
TEST(Problem10, Case1) {
string s{"aa"};
string p{"a"};
2022-11-30 10:20:36 +00:00
S0010 solution;
2022-11-03 06:57:32 +00:00
EXPECT_FALSE(solution.isMatch(s, p));
}
TEST(Problem10, Case2) {
string s{"aa"};
string p{"a*"};
2022-11-30 10:20:36 +00:00
S0010 solution;
2022-11-03 06:57:32 +00:00
EXPECT_TRUE(solution.isMatch(s, p));
}
TEST(Problem10, Case3) {
string s{"ab"};
string p{".*"};
2022-11-30 10:20:36 +00:00
S0010 solution;
2022-11-03 06:57:32 +00:00
EXPECT_TRUE(solution.isMatch(s, p));
}