-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathday11-test.cpp
More file actions
68 lines (44 loc) · 1.22 KB
/
day11-test.cpp
File metadata and controls
68 lines (44 loc) · 1.22 KB
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
65
66
67
#include <gtest/gtest.h>
#include <fstream>
#include <iostream>
#include <string>
#include <sstream>
#include "main.h"
using namespace std;
class Day11Test : public ::testing::Test{};
TEST_F( Day11Test, PuzzleInputPart1 ) {
ifstream is( "day11.input" );
ostringstream os;
mainfunc( is, os, Part::PART1 );
EXPECT_EQ( "743\n", os.str() );
}
TEST_F( Day11Test, Description1_1 ) {
istringstream is( "ne,ne,ne\n" );
ostringstream os;
mainfunc( is, os, Part::PART1 );
EXPECT_EQ( "3\n", os.str() );
}
TEST_F( Day11Test, Description1_2 ) {
istringstream is( "ne,ne,sw,sw\n" );
ostringstream os;
mainfunc( is, os, Part::PART1 );
EXPECT_EQ( "0\n", os.str() );
}
TEST_F( Day11Test, Description1_3 ) {
istringstream is( "ne,ne,s,s\n" );
ostringstream os;
mainfunc( is, os, Part::PART1 );
EXPECT_EQ( "2\n", os.str() );
}
TEST_F( Day11Test, Description1_4 ) {
istringstream is( "se,sw,se,sw,sw\n" );
ostringstream os;
mainfunc( is, os, Part::PART1 );
EXPECT_EQ( "3\n", os.str() );
}
TEST_F( Day11Test, PuzzleInputPart2 ) {
ifstream is( "day11.input" );
ostringstream os;
mainfunc( is, os, Part::PART2 );
EXPECT_EQ( "1493\n", os.str() );
}