This commit is contained in:
2022-11-21 16:51:23 +08:00
parent ba6f75b394
commit 0a13bff07b
3 changed files with 64 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
#include "s0032_longest_valid_parentheses.hpp"
#include <gtest/gtest.h>
TEST(Problem32, Case1) {
string i{"(()"};
int o{2};
Solution solution;
EXPECT_EQ(solution.longestValidParentheses(i), o);
}
TEST(Problem32, Case2) {
string i{")()())"};
int o{4};
Solution solution;
EXPECT_EQ(solution.longestValidParentheses(i), o);
}
TEST(Problem32, Case3) {
string i{"())"};
int o{2};
Solution solution;
EXPECT_EQ(solution.longestValidParentheses(i), o);
}
TEST(Problem32, Case4) {
string i{"()(()"};
int o{2};
Solution solution;
EXPECT_EQ(solution.longestValidParentheses(i), o);
}