-
Notifications
You must be signed in to change notification settings - Fork 481
/
Copy path0055-test.cpp
64 lines (54 loc) · 1.16 KB
/
0055-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
58
59
60
61
62
63
64
#include <iostream>
#include <gtest/gtest.h>
#include <string>
#include "../src/0055-Jump-Game/0055.cpp"
TEST(test, test1)
{
vector<int> nums = {0, 2, 3};
ASSERT_EQ(false, Solution().canJump(nums));
}
TEST(test, test2)
{
vector<int> nums = {1, 2};
ASSERT_EQ(true, Solution().canJump(nums));
}
TEST(test, test3)
{
vector<int> nums = {2, 3, 1, 1, 4};
ASSERT_EQ(true, Solution().canJump(nums));
}
TEST(test, test4)
{
vector<int> nums = {5, 9, 3, 2, 1, 0, 2, 3, 3, 1, 0, 0};
ASSERT_EQ(true, Solution().canJump(nums));
}
TEST(test, test5)
{
vector<int> nums = {2, 0, 0};
ASSERT_EQ(true, Solution().canJump(nums));
}
TEST(test, test6)
{
vector<int> nums = {2, 0};
ASSERT_EQ(true, Solution().canJump(nums));
}
TEST(test, test7)
{
vector<int> nums = {1, 1, 0, 1};
ASSERT_EQ(false, Solution().canJump(nums));
}
TEST(test, test8)
{
vector<int> nums = {0};
ASSERT_EQ(true, Solution().canJump(nums));
}
TEST(test, test9)
{
vector<int> nums = {3, 2, 1, 0, 4};
ASSERT_EQ(false, Solution().canJump(nums));
}
GTEST_API_ int main(int argc, char **argv)
{
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}