Skip to content

Commit 54d5e70

Browse files
committed
Update test.cpp
1 parent cfa00ae commit 54d5e70

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

check-if-it-is-a-good-array/test.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,26 @@ TEST(check_if_it_is_a_good_array, test1)
2020
// EXPECT_NE(3, sum(3, 4)); // 求合3+4 != 3
2121
EXPECT_EQ(output, Solution().isGoodArray(nums));
2222
};
23+
TEST(check_if_it_is_a_good_array, test2)
24+
{
25+
26+
auto nums = vector<int>{ 29,6,10 };
27+
28+
auto output = true;
29+
// EXPECT_EQ(5, sum(2, 3)); // 求合2+3=5
30+
// EXPECT_NE(3, sum(3, 4)); // 求合3+4 != 3
31+
EXPECT_EQ(output, Solution().isGoodArray(nums));
32+
};
33+
TEST(check_if_it_is_a_good_array, test3)
34+
{
35+
36+
auto nums = vector<int>{3,6 };
37+
38+
auto output = false;
39+
// EXPECT_EQ(5, sum(2, 3)); // 求合2+3=5
40+
// EXPECT_NE(3, sum(3, 4)); // 求合3+4 != 3
41+
EXPECT_EQ(output, Solution().isGoodArray(nums));
42+
};
2343

2444
// 如果在此处不写main函数,那么在链接库的时候还需要链接-lgtest_main, 否则只需链接-lgtest即可。
2545
// #if 0

0 commit comments

Comments
 (0)