aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorkaiwu <kaiwu2004@gmail.com>2022-04-05 10:59:17 +0800
committerkaiwu <kaiwu2004@gmail.com>2022-04-05 10:59:17 +0800
commit19663fdfb6c2c61ee6f31c03cfe5277253cfa44e (patch)
treed80b477d6a2c406663d87caaf253628a632a653e /test
parent5e9ceee3104714002bb9e0aaffef78ef12e27fc6 (diff)
downloadadvent-of-code-19663fdfb6c2c61ee6f31c03cfe5277253cfa44e.tar.gz
advent-of-code-19663fdfb6c2c61ee6f31c03cfe5277253cfa44e.zip
2018 day2
Diffstat (limited to 'test')
-rw-r--r--test/test_2018.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test_2018.cpp b/test/test_2018.cpp
index fcd68ef..d74ec13 100644
--- a/test/test_2018.cpp
+++ b/test/test_2018.cpp
@@ -2,6 +2,7 @@
#include "2018/day2/aoc.h"
#include "catch.hpp"
#include <stdio.h>
+#include <string.h>
TEST_CASE("Chronal Calibration", "[2018]") {
line_view lv = load_file("../src/2018/day1/input");
@@ -11,3 +12,11 @@ TEST_CASE("Chronal Calibration", "[2018]") {
// REQUIRE(5 == aoc2018::day1part2("-6\n+3\n+8\n+5\n-6"));
// REQUIRE(14 == aoc2018::day1part2("+7\n+7\n-2\n-7\n-4"));
}
+
+TEST_CASE("Inventory Management System", "[2018]") {
+ line_view lv = load_file("../src/2018/day2/input");
+ char common[26] = {0};
+ auto p = aoc2018::day2(lv, common);
+ REQUIRE(6642 == p);
+ REQUIRE(strcmp("cvqlbidheyujgtrswxmckqnap", common) == 0);
+}