leetcode/tests/s0006_zigzag_conversion.cpp

28 lines
545 B
C++
Raw Normal View History

2022-11-02 12:19:54 +00:00
#include "s0006_zigzag_conversion.hpp"
#include <gtest/gtest.h>
TEST(Problem6, Case1) {
string s("PAYPALISHIRING");
int rows = 3;
string r("PAHNAPLSIIGYIR");
2022-11-30 10:20:36 +00:00
S0006 solution;
2022-11-02 12:19:54 +00:00
EXPECT_TRUE(solution.convert(s, rows) == r);
}
TEST(Problem6, Case2) {
string s("PAYPALISHIRING");
int rows = 4;
string r("PINALSIGYAHRPI");
2022-11-30 10:20:36 +00:00
S0006 solution;
2022-11-02 12:19:54 +00:00
EXPECT_TRUE(solution.convert(s, rows) == r);
}
TEST(Problem6, Case3) {
string s("AB");
int rows = 4;
string r("AB");
2022-11-30 10:20:36 +00:00
S0006 solution;
2022-11-02 12:19:54 +00:00
EXPECT_TRUE(solution.convert(s, rows) == r);
}