-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.cpp
More file actions
37 lines (26 loc) · 898 Bytes
/
test.cpp
File metadata and controls
37 lines (26 loc) · 898 Bytes
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
#include "c-echo.h"
#include "gtest/gtest.h"
TEST(EchoTest, HelloWorld) {
char* test_val[3]; test_val[0] = "./c-echo"; test_val[1] = "hello"; test_val[2] = "world";
EXPECT_EQ("hello world", echo(3,test_val));
}
TEST(EchoTest, EmptyString) {
char* test_val[1]; test_val[0] = "./c-echo";
EXPECT_EQ("", echo(1,test_val));
}
TEST(EchoTest,abc){
char* test_val[2]; test_val[0] = "./c-ehco"; test_val[1] = "abc";
EXPECT_EQ("abc",echo(2,test_val));
}
TEST(EchoTest,integer) {
char* test_val[3]; test_val[0] = "./c-echo"; test_val[1] = "123"; test_val[2] = "098";
EXPECT_EQ("123 098", echo(3,test_val));
}
TEST(EchoTest, nlANDbell) {
char* test_val[3]; test_val[0] = "./c-echo"; test_val[1] = "\n"; test_val[2] = "\a";
EXPECT_EQ("\n \a", echo(3,test_val));
}
int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}