This commit is contained in:
27
tests/s0006_zigzag_conversion.cpp
Normal file
27
tests/s0006_zigzag_conversion.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#include "s0006_zigzag_conversion.hpp"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
TEST(Problem6, Case1) {
|
||||
string s("PAYPALISHIRING");
|
||||
int rows = 3;
|
||||
string r("PAHNAPLSIIGYIR");
|
||||
Solution solution;
|
||||
EXPECT_TRUE(solution.convert(s, rows) == r);
|
||||
}
|
||||
|
||||
TEST(Problem6, Case2) {
|
||||
string s("PAYPALISHIRING");
|
||||
int rows = 4;
|
||||
string r("PINALSIGYAHRPI");
|
||||
Solution solution;
|
||||
EXPECT_TRUE(solution.convert(s, rows) == r);
|
||||
}
|
||||
|
||||
TEST(Problem6, Case3) {
|
||||
string s("AB");
|
||||
int rows = 4;
|
||||
string r("AB");
|
||||
Solution solution;
|
||||
EXPECT_TRUE(solution.convert(s, rows) == r);
|
||||
}
|
Reference in New Issue
Block a user