aboutsummaryrefslogtreecommitdiff
path: root/test/test_2017.cpp
blob: 1dfb9e0817e04b7bcf3bc740797bec9c0d403eca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "2017/day1/aoc.h"
#include "catch.hpp"
#include <stdio.h>

TEST_CASE("Inverse Captcha", "[2017]") {
  line_view lv = load_file("../src/2017/day1/input");
  REQUIRE(1253 == aoc2017::day1(lv));
  REQUIRE(4 == aoc2017::day1("1111"));
  REQUIRE(3 == aoc2017::day1("1122"));
  REQUIRE(1278 == aoc2017::day1part2(lv));
  REQUIRE(6 == aoc2017::day1part2("1212"));
  REQUIRE(0 == aoc2017::day1part2("1221"));
  REQUIRE(4 == aoc2017::day1part2("123425"));
  REQUIRE(12 == aoc2017::day1part2("123123"));
  REQUIRE(4 == aoc2017::day1part2("12131415"));
}