File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
check-if-it-is-a-good-array Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,26 @@ TEST(check_if_it_is_a_good_array, test1)
20
20
// EXPECT_NE(3, sum(3, 4)); // 求合3+4 != 3
21
21
EXPECT_EQ (output, Solution ().isGoodArray (nums));
22
22
};
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
+ };
23
43
24
44
// 如果在此处不写main函数,那么在链接库的时候还需要链接-lgtest_main, 否则只需链接-lgtest即可。
25
45
// #if 0
You can’t perform that action at this time.
0 commit comments