diff options
author | kaiwu <kaiwu2004@gmail.com> | 2022-03-15 10:49:19 +0800 |
---|---|---|
committer | kaiwu <kaiwu2004@gmail.com> | 2022-03-15 10:49:19 +0800 |
commit | 869443933e5686433ef92fbcad7cd377017651b2 (patch) | |
tree | 432a2d4311ac3a3dff0406bbd2410d690adc8395 /test/test_2015.cpp | |
parent | 8c0bc49502ee9101d3f761cd791ebe770012d26d (diff) | |
download | advent-of-code-869443933e5686433ef92fbcad7cd377017651b2.tar.gz advent-of-code-869443933e5686433ef92fbcad7cd377017651b2.zip |
day2 part1
Diffstat (limited to 'test/test_2015.cpp')
-rw-r--r-- | test/test_2015.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/test/test_2015.cpp b/test/test_2015.cpp index 7955ede..84ddcbe 100644 --- a/test/test_2015.cpp +++ b/test/test_2015.cpp @@ -1,9 +1,26 @@ -#include "catch.hpp" #include "2015/day1/aoc.h" +#include "2015/day2/aoc.h" +#include "catch.hpp" #include <stdio.h> -TEST_CASE("Not Quite Lisp", "[]") { +TEST_CASE("Not Quite Lisp", "[day1]") { line_view lv = load_file("../src/2015/day1/input"); REQUIRE(aoc2015::day1(lv) == 74); REQUIRE(aoc2015::day1(lv, -1) == 1795); } + +TEST_CASE("parse box", "[day2]") { + line_view lv1{"27x2x5\n", 7}; + auto b1 = aoc2015::parse_day2(lv1); + auto a1 = b1.l == 27 && b1.w == 2 && b1.h == 5; + REQUIRE(a1); + line_view lv2{"29x13x26\n", 9}; + auto b2 = aoc2015::parse_day2(lv2); + auto a2 = b2.l == 29 && b2.w == 13 && b2.h == 26; + REQUIRE(a2); +} + +TEST_CASE("I Was Told There Would Be No Math", "[day2]") { + line_view lv = load_file("../src/2015/day2/input"); + printf("%d\n", aoc2015::day2(lv)); +} |