diff options
author | kaiwu <kaiwu2004@gmail.com> | 2022-03-16 14:37:14 +0800 |
---|---|---|
committer | kaiwu <kaiwu2004@gmail.com> | 2022-03-16 14:37:14 +0800 |
commit | c69f8f28285fd507aa27ae0a18b614f371a2ae1d (patch) | |
tree | 9f3da71d7e0395d9a8e7124ae82ccde7e47e5cff /test/test_2015.cpp | |
parent | 6aa919cbe332d7e45c0c3a7954d48166f4b774c0 (diff) | |
download | advent-of-code-c69f8f28285fd507aa27ae0a18b614f371a2ae1d.tar.gz advent-of-code-c69f8f28285fd507aa27ae0a18b614f371a2ae1d.zip |
day5 part1
Diffstat (limited to 'test/test_2015.cpp')
-rw-r--r-- | test/test_2015.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/test_2015.cpp b/test/test_2015.cpp index 8eeaf99..03ab285 100644 --- a/test/test_2015.cpp +++ b/test/test_2015.cpp @@ -50,6 +50,19 @@ TEST_CASE("The Ideal Stocking Stuffer", "[day4]") { } TEST_CASE("Doesn't He Have Intern-Elves For This?", "[day5]") { - //line_view lv = load_file("../src/2015/day5/input"); + line_view lv{"adcccfadd", 9}; + REQUIRE(aoc2015::count_vowels(lv, "aeiou") == 2); + REQUIRE(aoc2015::count_vowels(lv, "eiou") == 0); + REQUIRE(aoc2015::is_nice(lv, 2)); + REQUIRE(aoc2015::is_nice(lv, 3)); + REQUIRE(!aoc2015::is_nice(lv, 4)); + const char* sub1[] = {"xy", "dx"}; + const char* sub2[] = {"xy", "fadd", "dx"}; + REQUIRE(lv.contains(sub2[1])); + REQUIRE(aoc2015::is_nice(lv, sub1, ARRAY_SIZE(sub1))); + REQUIRE(!aoc2015::is_nice(lv, sub2, ARRAY_SIZE(sub2))); + + line_view ss = load_file("../src/2015/day5/input"); + REQUIRE(aoc2015::day5(ss) == 255); } |