-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsplit_str_1_test.cpp
39 lines (32 loc) · 960 Bytes
/
split_str_1_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
#include <gtest/gtest.h>
#include "split_str_1_lib.h"
TEST(SplitStr1Test, GetOutputSingleWord) {
string str("hello");
string output = getOutput(str);
string expected("hello\n");
EXPECT_TRUE(expected == output);
}
TEST(SplitStr1Test, GetOutputSingleWordSpaceBefore) {
string str(" hello");
string output = getOutput(str);
string expected("hello\n");
EXPECT_TRUE(expected == output);
}
TEST(SplitStr1Test, GetOutputSingleWordSpaceAfter) {
string str("hello ");
string output = getOutput(str);
string expected("hello\n");
EXPECT_TRUE(expected == output);
}
TEST(SplitStr1Test, GetOutputTwoWords) {
string str("hello world");
string output = getOutput(str);
string expected("hello\nworld\n");
EXPECT_TRUE(expected == output);
}
TEST(SplitStr1Test, GetOutputTwoWordsDoubleSpaceBetween) {
string str("hello world");
string output = getOutput(str);
string expected("hello\nworld\n");
EXPECT_TRUE(expected == output);
}