@@ -11,16 +11,7 @@ using namespace AdventOfCode24::Day4;
1111 #error "ADVENT_OF_CODE_DATA is not defined!"
1212#endif
1313
14- TEST (TestAOC, TestDay4pt1_block_parse) {
15- spdlog::set_level (spdlog::level::debug);
16- const std::string word{" XMAS" };
17- const std::deque<std::string> block{" XMASFVX." , " MMDNTMY." , " AIAWAZV." , " STCSAMX." , " ZNAAALA." , " QMTMMMM." , " XIYXJFX." , " ......." };
18- const int n_matches{wordsearch_matches (word, block, 0 )};
19-
20- ASSERT_EQ (n_matches, 8 );
21- }
22-
23- TEST (TestAOC, TestDay4pt1_1) {
14+ TEST (TestAOC, TestDay4pt1_example) {
2415 spdlog::set_level (spdlog::level::debug);
2516 const std::string word{" XMAS" };
2617 const std::filesystem::path input_file = std::filesystem::path (ADVENT_OF_CODE_DATA) / " day_4_1.txt" ;
@@ -29,21 +20,35 @@ TEST(TestAOC, TestDay4pt1_1) {
2920 ASSERT_EQ (word_count, 18 );
3021}
3122
32- TEST (TestAOC, TestDay4pt2) {
33- spdlog::set_level (spdlog::level::debug);
23+ TEST (TestAOC, TestDay4pt2_example_1) {
3424 const std::string word{" MAS" };
3525 const std::filesystem::path input_file = std::filesystem::path (ADVENT_OF_CODE_DATA) / " day_4_1.txt" ;
3626 const int word_count{AdventOfCode24::Day4::count_matches_in_file (input_file, word, false )};
3727
3828 ASSERT_EQ (word_count, 9 );
3929}
4030
41- TEST (TestAOC, TestDay4pt1_2) {
42- spdlog::set_level (spdlog::level::debug);
31+ TEST (TestAOC, TestDay4pt1_example_2) {
4332 const std::string word{" XMAS" };
4433 const std::filesystem::path input_file = std::filesystem::path (ADVENT_OF_CODE_DATA) / " day_4_2.txt" ;
4534 const int word_count{AdventOfCode24::Day4::count_matches_in_file (input_file, word, true )};
4635
4736 ASSERT_EQ (word_count, 18 );
4837}
4938
39+ TEST (TestAOC, TestDay4pt1) {
40+ const std::string word{" XMAS" };
41+ const std::filesystem::path input_file = std::filesystem::path (ADVENT_OF_CODE_DATA) / " .." / " .." / " solutions" / " data" / " day_4.txt" ;
42+ const int word_count{AdventOfCode24::Day4::count_matches_in_file (input_file, word, true )};
43+
44+ ASSERT_EQ (word_count, 2654 );
45+ }
46+
47+ TEST (TestAOC, TestDay4pt2) {
48+ const std::string word{" MAS" };
49+ const std::filesystem::path input_file = std::filesystem::path (ADVENT_OF_CODE_DATA) / " .." / " .." / " solutions" / " data" / " day_4.txt" ;
50+ const int word_count{AdventOfCode24::Day4::count_matches_in_file (input_file, word, false )};
51+
52+ ASSERT_EQ (word_count, 1990 );
53+ }
54+
0 commit comments