-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththe-maze-test.cpp
39 lines (35 loc) · 905 Bytes
/
the-maze-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
/*
* Copyright (c) 2018 Christopher Friedt
*
* SPDX-License-Identifier: MIT
*/
#include <gtest/gtest.h>
#include "the-maze.cpp"
TEST(TheMaze, Test_Example1) {
vector<vector<int>> maze({
{0, 0, 1, 0, 0},
{0, 0, 0, 0, 0},
{0, 0, 0, 1, 0},
{1, 1, 0, 1, 1},
{0, 0, 0, 0, 0},
});
vector<int> start({0, 4});
vector<int> destination({4, 4});
bool expected_bool = true;
bool actual_bool = Solution().hasPath(maze, start, destination);
EXPECT_EQ(actual_bool, expected_bool);
}
TEST(TheMaze, Test_Example2) {
vector<vector<int>> maze({
{0, 0, 1, 0, 0},
{0, 0, 0, 0, 0},
{0, 0, 0, 1, 0},
{1, 1, 0, 1, 1},
{0, 0, 0, 0, 0},
});
vector<int> start({0, 4});
vector<int> destination({3, 2});
bool expected_bool = false;
bool actual_bool = Solution().hasPath(maze, start, destination);
EXPECT_EQ(actual_bool, expected_bool);
}