-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzigzag-conversion-test.cpp
57 lines (41 loc) · 1.22 KB
/
zigzag-conversion-test.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* Copyright (c) 2018 Christopher Friedt
*
* SPDX-License-Identifier: MIT
*/
#include <array>
using namespace std;
#include <gtest/gtest.h>
#include "zigzag-conversion.cpp"
TEST(ZigZagConversion, Test__PAYPALISHIRING__3) {
// string convert(string s, int numRows)
int numRows = 3;
string s("PAYPALISHIRING");
string expected_string("PAHNAPLSIIGYIR");
string actual_string = Solution().convert(s, numRows);
EXPECT_EQ(actual_string, expected_string);
}
TEST(ZigZagConversion, Test__A__3) {
// string convert(string s, int numRows)
int numRows = 3;
string s("A");
string expected_string("A");
string actual_string = Solution().convert(s, numRows);
EXPECT_EQ(actual_string, expected_string);
}
TEST(ZigZagConversion, Test__AB__4) {
// string convert(string s, int numRows)
int numRows = 4;
string s("AB");
string expected_string("AB");
string actual_string = Solution().convert(s, numRows);
EXPECT_EQ(actual_string, expected_string);
}
TEST(ZigZagConversion, Test__ABAB__2) {
// string convert(string s, int numRows)
int numRows = 2;
string s("ABAB");
string expected_string("AABB");
string actual_string = Solution().convert(s, numRows);
EXPECT_EQ(actual_string, expected_string);
}