leetcode/tests/s0020_valid_parentheses.cpp

32 lines
543 B
C++
Raw Normal View History

2022-11-04 09:22:15 +00:00
#include "s0020_valid_parentheses.hpp"
#include <gtest/gtest.h>
TEST(Problem20, Case1) {
string i{"()"};
bool o{true};
2022-11-30 10:20:36 +00:00
S0020 solution;
2022-11-04 09:22:15 +00:00
EXPECT_EQ(solution.isValid(i), o);
}
TEST(Problem20, Case2) {
string i{"()[]{}"};
bool o{true};
2022-11-30 10:20:36 +00:00
S0020 solution;
2022-11-04 09:22:15 +00:00
EXPECT_EQ(solution.isValid(i), o);
}
TEST(Problem20, Case3) {
string i{"(]"};
bool o{false};
2022-11-30 10:20:36 +00:00
S0020 solution;
2022-11-04 09:22:15 +00:00
EXPECT_EQ(solution.isValid(i), o);
}
TEST(Problem20, Case4) {
string i{"(){}}{"};
bool o{false};
2022-11-30 10:20:36 +00:00
S0020 solution;
2022-11-04 09:22:15 +00:00
EXPECT_EQ(solution.isValid(i), o);
}