leetcode/tests/s0022_generate_parentheses.cpp

25 lines
660 B
C++
Raw Normal View History

2022-11-14 02:27:21 +00:00
#include "s0022_generate_parentheses.hpp"
#include <gtest/gtest.h>
TEST(Problem22, Case1) {
int i{3};
vector<string> o{"((()))", "(()())", "(())()", "()(())", "()()()"};
2022-11-30 10:20:36 +00:00
S0022 solution;
2022-11-14 02:27:21 +00:00
EXPECT_EQ(solution.generateParenthesis(i), o);
}
TEST(Problem22, Case2) {
int i{1};
vector<string> o{"()"};
2022-11-30 10:20:36 +00:00
S0022 solution;
2022-11-14 02:27:21 +00:00
EXPECT_EQ(solution.generateParenthesis(i), o);
}
TEST(Problem22, Case3) {
int i{4};
vector<string> o{"(((())))","((()()))","((())())","((()))()","(()(()))","(()()())","(()())()","(())(())","(())()()","()((()))","()(()())","()(())()","()()(())","()()()()"};
2022-11-30 10:20:36 +00:00
S0022 solution;
2022-11-14 02:27:21 +00:00
EXPECT_EQ(solution.generateParenthesis(i), o);
}