File tree Expand file tree Collapse file tree 4 files changed +43
-0
lines changed
Expand file tree Collapse file tree 4 files changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ #pragma once
2+
3+ #include < fstream>
4+ #include < vector>
5+
6+ namespace AdventOfCode ::Day4 {
7+ int get_matches (const std::string& word, const std::vector<std::string>& block);
8+ };
Original file line number Diff line number Diff line change 1+ #include " advent_of_code/day_4.hxx"
2+
3+ namespace AdventOfCode ::Day4 {
4+ int get_matches (const std::string& word, const std::vector<std::string> block) {
5+ }
6+ };
Original file line number Diff line number Diff line change 1+ MMMSXXMASM
2+ MSAMXMSMSA
3+ AMXSXMAAMM
4+ MSAMASMSMX
5+ XMASAMXAMM
6+ XXAMMXXAMA
7+ SMSMSASXSS
8+ SAXAMASAAA
9+ MAMMMXMMMM
10+ MXMXAXMASX
Original file line number Diff line number Diff line change 1+
2+ #include < gtest/gtest.h>
3+ #include < string>
4+ #include " advent_of_code/day_3.hxx"
5+
6+ using namespace AdventOfCode ::Day4;
7+
8+ #ifndef ADVENT_OF_CODE_DATA
9+ #error "ADVENT_OF_CODE_DATA is not defined!"
10+ #endif
11+
12+ TEST (TestAOC, TestDay4pt1_block_parse) {
13+ const std::string word{" XMAS" };
14+ const std::string block{" XJYSAMXOTX\n MHRHXMASMD\n AGKUWQAP\n SCYKOSTRY\n " };
15+ const int n_matches{get_matches (word, block)};
16+
17+ ASSERT_EQ (n_matches, 4 );
18+ }
19+
You can’t perform that action at this time.
0 commit comments