32 lines
598 B
C++
32 lines
598 B
C++
#include "s0032_longest_valid_parentheses.hpp"
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
TEST(Problem32, Case1) {
|
|
string i{"(()"};
|
|
int o{2};
|
|
S0032 solution;
|
|
EXPECT_EQ(solution.longestValidParentheses(i), o);
|
|
}
|
|
|
|
TEST(Problem32, Case2) {
|
|
string i{")()())"};
|
|
int o{4};
|
|
S0032 solution;
|
|
EXPECT_EQ(solution.longestValidParentheses(i), o);
|
|
}
|
|
|
|
TEST(Problem32, Case3) {
|
|
string i{"())"};
|
|
int o{2};
|
|
S0032 solution;
|
|
EXPECT_EQ(solution.longestValidParentheses(i), o);
|
|
}
|
|
|
|
TEST(Problem32, Case4) {
|
|
string i{"()(()"};
|
|
int o{2};
|
|
S0032 solution;
|
|
EXPECT_EQ(solution.longestValidParentheses(i), o);
|
|
}
|