From 79a832c744717db0d1d0d49df939ace1022b1be2 Mon Sep 17 00:00:00 2001 From: Oleg Balunenko Date: Thu, 1 Dec 2022 19:53:22 +0400 Subject: [PATCH] chore: Add regression tests for 2022 year (#209) --- tests/regression_2015_test.go | 364 +++++ tests/regression_2016_test.go | 364 +++++ tests/regression_2017_test.go | 364 +++++ tests/regression_2018_test.go | 364 +++++ tests/regression_2019_test.go | 364 +++++ tests/regression_2020_test.go | 364 +++++ tests/regression_2021_test.go | 364 +++++ tests/regression_2022_test.go | 364 +++++ tests/regression_test.go | 2524 +-------------------------------- 9 files changed, 2931 insertions(+), 2505 deletions(-) create mode 100644 tests/regression_2015_test.go create mode 100644 tests/regression_2016_test.go create mode 100644 tests/regression_2017_test.go create mode 100644 tests/regression_2018_test.go create mode 100644 tests/regression_2019_test.go create mode 100644 tests/regression_2020_test.go create mode 100644 tests/regression_2021_test.go create mode 100644 tests/regression_2022_test.go diff --git a/tests/regression_2015_test.go b/tests/regression_2015_test.go new file mode 100644 index 00000000..155bd9de --- /dev/null +++ b/tests/regression_2015_test.go @@ -0,0 +1,364 @@ +package tests_test + +import ( + "testing" + + "github.com/obalunenko/advent-of-code/internal/puzzles" +) + +func testcases2015(tb testing.TB) []testcase { + year := puzzles.Year2015 + + return []testcase{ + { + name: tcName(tb, year, puzzles.Day01), + args: args{ + year: year.String(), + name: puzzles.Day01.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day01.String(), + Part1: "232", + Part2: "1783", + }, + wantErr: false, + }, + { + name: tcName(tb, year, puzzles.Day02), + args: args{ + year: year.String(), + name: puzzles.Day02.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day02.String(), + Part1: "1598415", + Part2: "3812909", + }, + wantErr: false, + }, + { + name: tcName(tb, year, puzzles.Day03), + args: args{ + year: year.String(), + name: puzzles.Day03.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day03.String(), + Part1: "2565", + Part2: "2639", + }, + wantErr: false, + }, + { + name: tcName(tb, year, puzzles.Day04), + args: args{ + year: year.String(), + name: puzzles.Day04.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day04.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day05), + args: args{ + year: year.String(), + name: puzzles.Day05.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day05.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day06), + args: args{ + year: year.String(), + name: puzzles.Day06.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day06.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day07), + args: args{ + year: year.String(), + name: puzzles.Day07.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day07.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day08), + args: args{ + year: year.String(), + name: puzzles.Day08.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day08.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day09), + args: args{ + year: year.String(), + name: puzzles.Day09.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day09.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day10), + args: args{ + year: year.String(), + name: puzzles.Day10.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day10.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day11), + args: args{ + year: year.String(), + name: puzzles.Day11.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day11.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day12), + args: args{ + year: year.String(), + name: puzzles.Day12.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day12.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day13), + args: args{ + year: year.String(), + name: puzzles.Day13.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day13.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day14), + args: args{ + year: year.String(), + name: puzzles.Day14.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day14.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day15), + args: args{ + year: year.String(), + name: puzzles.Day15.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day15.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day16), + args: args{ + year: year.String(), + name: puzzles.Day16.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day16.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day17), + args: args{ + year: year.String(), + name: puzzles.Day17.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day17.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day18), + args: args{ + year: year.String(), + name: puzzles.Day18.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day18.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day19), + args: args{ + year: year.String(), + name: puzzles.Day19.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day19.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day20), + args: args{ + year: year.String(), + name: puzzles.Day20.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day20.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day21), + args: args{ + year: year.String(), + name: puzzles.Day21.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day21.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day22), + args: args{ + year: year.String(), + name: puzzles.Day22.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day22.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day23), + args: args{ + year: year.String(), + name: puzzles.Day23.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day23.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day24), + args: args{ + year: year.String(), + name: puzzles.Day24.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day24.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day25), + args: args{ + year: year.String(), + name: puzzles.Day25.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day25.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + } +} diff --git a/tests/regression_2016_test.go b/tests/regression_2016_test.go new file mode 100644 index 00000000..854bd02d --- /dev/null +++ b/tests/regression_2016_test.go @@ -0,0 +1,364 @@ +package tests_test + +import ( + "testing" + + "github.com/obalunenko/advent-of-code/internal/puzzles" +) + +func testcases2016(tb testing.TB) []testcase { + year := puzzles.Year2016 + + return []testcase{ + { + name: tcName(tb, year, puzzles.Day01), + args: args{ + year: year.String(), + name: puzzles.Day01.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day01.String(), + Part1: "307", + Part2: "165", + }, + wantErr: false, + }, + { + name: tcName(tb, year, puzzles.Day02), + args: args{ + year: year.String(), + name: puzzles.Day02.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day02.String(), + Part1: "48584", + Part2: "563B6", + }, + wantErr: false, + }, + { + name: tcName(tb, year, puzzles.Day03), + args: args{ + year: year.String(), + name: puzzles.Day03.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day03.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day04), + args: args{ + year: year.String(), + name: puzzles.Day04.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day04.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day05), + args: args{ + year: year.String(), + name: puzzles.Day05.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day05.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day06), + args: args{ + year: year.String(), + name: puzzles.Day06.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day06.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day07), + args: args{ + year: year.String(), + name: puzzles.Day07.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day07.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day08), + args: args{ + year: year.String(), + name: puzzles.Day08.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day08.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day09), + args: args{ + year: year.String(), + name: puzzles.Day09.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day09.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day10), + args: args{ + year: year.String(), + name: puzzles.Day10.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day10.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day11), + args: args{ + year: year.String(), + name: puzzles.Day11.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day11.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day12), + args: args{ + year: year.String(), + name: puzzles.Day12.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day12.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day13), + args: args{ + year: year.String(), + name: puzzles.Day13.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day13.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day14), + args: args{ + year: year.String(), + name: puzzles.Day14.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day14.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day15), + args: args{ + year: year.String(), + name: puzzles.Day15.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day15.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day16), + args: args{ + year: year.String(), + name: puzzles.Day16.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day16.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day17), + args: args{ + year: year.String(), + name: puzzles.Day17.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day17.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day18), + args: args{ + year: year.String(), + name: puzzles.Day18.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day18.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day19), + args: args{ + year: year.String(), + name: puzzles.Day19.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day19.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day20), + args: args{ + year: year.String(), + name: puzzles.Day20.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day20.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day21), + args: args{ + year: year.String(), + name: puzzles.Day21.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day21.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day22), + args: args{ + year: year.String(), + name: puzzles.Day22.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day22.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day23), + args: args{ + year: year.String(), + name: puzzles.Day23.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day23.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day24), + args: args{ + year: year.String(), + name: puzzles.Day24.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day24.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day25), + args: args{ + year: year.String(), + name: puzzles.Day25.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day25.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + } +} diff --git a/tests/regression_2017_test.go b/tests/regression_2017_test.go new file mode 100644 index 00000000..275200d1 --- /dev/null +++ b/tests/regression_2017_test.go @@ -0,0 +1,364 @@ +package tests_test + +import ( + "testing" + + "github.com/obalunenko/advent-of-code/internal/puzzles" +) + +func testcases2017(tb testing.TB) []testcase { + year := puzzles.Year2017 + + return []testcase{ + { + name: tcName(tb, year, puzzles.Day01), + args: args{ + year: year.String(), + name: puzzles.Day01.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day01.String(), + Part1: "1029", + Part2: "1220", + }, + wantErr: false, + }, + { + name: tcName(tb, year, puzzles.Day02), + args: args{ + year: year.String(), + name: puzzles.Day02.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day02.String(), + Part1: "32020", + Part2: "236", + }, + wantErr: false, + }, + { + name: tcName(tb, year, puzzles.Day03), + args: args{ + year: year.String(), + name: puzzles.Day03.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day03.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day04), + args: args{ + year: year.String(), + name: puzzles.Day04.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day04.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day05), + args: args{ + year: year.String(), + name: puzzles.Day05.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day05.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day06), + args: args{ + year: year.String(), + name: puzzles.Day06.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day06.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day07), + args: args{ + year: year.String(), + name: puzzles.Day07.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day07.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day08), + args: args{ + year: year.String(), + name: puzzles.Day08.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day08.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day09), + args: args{ + year: year.String(), + name: puzzles.Day09.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day09.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day10), + args: args{ + year: year.String(), + name: puzzles.Day10.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day10.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day11), + args: args{ + year: year.String(), + name: puzzles.Day11.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day11.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day12), + args: args{ + year: year.String(), + name: puzzles.Day12.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day12.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day13), + args: args{ + year: year.String(), + name: puzzles.Day13.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day13.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day14), + args: args{ + year: year.String(), + name: puzzles.Day14.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day14.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day15), + args: args{ + year: year.String(), + name: puzzles.Day15.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day15.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day16), + args: args{ + year: year.String(), + name: puzzles.Day16.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day16.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day17), + args: args{ + year: year.String(), + name: puzzles.Day17.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day17.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day18), + args: args{ + year: year.String(), + name: puzzles.Day18.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day18.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day19), + args: args{ + year: year.String(), + name: puzzles.Day19.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day19.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day20), + args: args{ + year: year.String(), + name: puzzles.Day20.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day20.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day21), + args: args{ + year: year.String(), + name: puzzles.Day21.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day21.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day22), + args: args{ + year: year.String(), + name: puzzles.Day22.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day22.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day23), + args: args{ + year: year.String(), + name: puzzles.Day23.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day23.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day24), + args: args{ + year: year.String(), + name: puzzles.Day24.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day24.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day25), + args: args{ + year: year.String(), + name: puzzles.Day25.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day25.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + } +} diff --git a/tests/regression_2018_test.go b/tests/regression_2018_test.go new file mode 100644 index 00000000..446611f4 --- /dev/null +++ b/tests/regression_2018_test.go @@ -0,0 +1,364 @@ +package tests_test + +import ( + "testing" + + "github.com/obalunenko/advent-of-code/internal/puzzles" +) + +func testcases2018(tb testing.TB) []testcase { + year := puzzles.Year2018 + + return []testcase{ + { + name: tcName(tb, year, puzzles.Day01), + args: args{ + year: year.String(), + name: puzzles.Day01.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day01.String(), + Part1: "439", + Part2: "124645", + }, + wantErr: false, + }, + { + name: tcName(tb, year, puzzles.Day02), + args: args{ + year: year.String(), + name: puzzles.Day02.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day02.String(), + Part1: "6944", + Part2: "srijafjzloguvlntqmphenbkd", + }, + wantErr: false, + }, + { + name: tcName(tb, year, puzzles.Day03), + args: args{ + year: year.String(), + name: puzzles.Day03.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day03.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day04), + args: args{ + year: year.String(), + name: puzzles.Day04.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day04.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day05), + args: args{ + year: year.String(), + name: puzzles.Day05.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day05.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day06), + args: args{ + year: year.String(), + name: puzzles.Day06.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day06.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day07), + args: args{ + year: year.String(), + name: puzzles.Day07.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day07.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day08), + args: args{ + year: year.String(), + name: puzzles.Day08.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day08.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day09), + args: args{ + year: year.String(), + name: puzzles.Day09.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day09.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day10), + args: args{ + year: year.String(), + name: puzzles.Day10.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day10.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day11), + args: args{ + year: year.String(), + name: puzzles.Day11.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day11.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day12), + args: args{ + year: year.String(), + name: puzzles.Day12.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day12.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day13), + args: args{ + year: year.String(), + name: puzzles.Day13.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day13.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day14), + args: args{ + year: year.String(), + name: puzzles.Day14.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day14.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day15), + args: args{ + year: year.String(), + name: puzzles.Day15.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day15.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day16), + args: args{ + year: year.String(), + name: puzzles.Day16.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day16.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day17), + args: args{ + year: year.String(), + name: puzzles.Day17.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day17.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day18), + args: args{ + year: year.String(), + name: puzzles.Day18.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day18.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day19), + args: args{ + year: year.String(), + name: puzzles.Day19.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day19.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day20), + args: args{ + year: year.String(), + name: puzzles.Day20.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day20.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day21), + args: args{ + year: year.String(), + name: puzzles.Day21.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day21.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day22), + args: args{ + year: year.String(), + name: puzzles.Day22.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day22.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day23), + args: args{ + year: year.String(), + name: puzzles.Day23.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day23.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day24), + args: args{ + year: year.String(), + name: puzzles.Day24.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day24.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day25), + args: args{ + year: year.String(), + name: puzzles.Day25.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day25.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + } +} diff --git a/tests/regression_2019_test.go b/tests/regression_2019_test.go new file mode 100644 index 00000000..3279d7da --- /dev/null +++ b/tests/regression_2019_test.go @@ -0,0 +1,364 @@ +package tests_test + +import ( + "testing" + + "github.com/obalunenko/advent-of-code/internal/puzzles" +) + +func testcases2019(tb testing.TB) []testcase { + year := puzzles.Year2019 + + return []testcase{ + { + name: tcName(tb, year, puzzles.Day01), + args: args{ + year: year.String(), + name: puzzles.Day01.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day01.String(), + Part1: "3464458", + Part2: "5193796", + }, + wantErr: false, + }, + { + name: tcName(tb, year, puzzles.Day02), + args: args{ + year: year.String(), + name: puzzles.Day02.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day02.String(), + Part1: "2890696", + Part2: "8226", + }, + wantErr: false, + }, + { + name: tcName(tb, year, puzzles.Day03), + args: args{ + year: year.String(), + name: puzzles.Day03.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day03.String(), + Part1: "1195", + Part2: "91518", + }, + wantErr: false, + }, + { + name: tcName(tb, year, puzzles.Day04), + args: args{ + year: year.String(), + name: puzzles.Day04.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day04.String(), + Part1: "2779", + Part2: "1972", + }, + wantErr: false, + }, + { + name: tcName(tb, year, puzzles.Day05), + args: args{ + year: year.String(), + name: puzzles.Day05.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day05.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day06), + args: args{ + year: year.String(), + name: puzzles.Day06.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day06.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day07), + args: args{ + year: year.String(), + name: puzzles.Day07.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day07.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day08), + args: args{ + year: year.String(), + name: puzzles.Day08.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day08.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day09), + args: args{ + year: year.String(), + name: puzzles.Day09.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day09.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day10), + args: args{ + year: year.String(), + name: puzzles.Day10.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day10.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day11), + args: args{ + year: year.String(), + name: puzzles.Day11.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day11.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day12), + args: args{ + year: year.String(), + name: puzzles.Day12.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day12.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day13), + args: args{ + year: year.String(), + name: puzzles.Day13.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day13.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day14), + args: args{ + year: year.String(), + name: puzzles.Day14.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day14.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day15), + args: args{ + year: year.String(), + name: puzzles.Day15.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day15.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day16), + args: args{ + year: year.String(), + name: puzzles.Day16.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day16.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day17), + args: args{ + year: year.String(), + name: puzzles.Day17.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day17.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day18), + args: args{ + year: year.String(), + name: puzzles.Day18.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day18.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day19), + args: args{ + year: year.String(), + name: puzzles.Day19.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day19.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day20), + args: args{ + year: year.String(), + name: puzzles.Day20.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day20.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day21), + args: args{ + year: year.String(), + name: puzzles.Day21.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day21.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day22), + args: args{ + year: year.String(), + name: puzzles.Day22.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day22.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day23), + args: args{ + year: year.String(), + name: puzzles.Day23.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day23.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day24), + args: args{ + year: year.String(), + name: puzzles.Day24.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day24.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day25), + args: args{ + year: year.String(), + name: puzzles.Day25.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day25.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + } +} diff --git a/tests/regression_2020_test.go b/tests/regression_2020_test.go new file mode 100644 index 00000000..8036dfa2 --- /dev/null +++ b/tests/regression_2020_test.go @@ -0,0 +1,364 @@ +package tests_test + +import ( + "testing" + + "github.com/obalunenko/advent-of-code/internal/puzzles" +) + +func testcases2020(tb testing.TB) []testcase { + year := puzzles.Year2020 + + return []testcase{ + { + name: tcName(tb, year, puzzles.Day01), + args: args{ + year: year.String(), + name: puzzles.Day01.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day01.String(), + Part1: "270144", + Part2: "261342720", + }, + wantErr: false, + }, + { + name: tcName(tb, year, puzzles.Day02), + args: args{ + year: year.String(), + name: puzzles.Day02.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day02.String(), + Part1: "456", + Part2: "308", + }, + wantErr: false, + }, + { + name: tcName(tb, year, puzzles.Day03), + args: args{ + year: year.String(), + name: puzzles.Day03.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day03.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day04), + args: args{ + year: year.String(), + name: puzzles.Day04.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day04.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day05), + args: args{ + year: year.String(), + name: puzzles.Day05.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day05.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day06), + args: args{ + year: year.String(), + name: puzzles.Day06.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day06.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day07), + args: args{ + year: year.String(), + name: puzzles.Day07.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day07.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day08), + args: args{ + year: year.String(), + name: puzzles.Day08.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day08.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day09), + args: args{ + year: year.String(), + name: puzzles.Day09.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day09.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day10), + args: args{ + year: year.String(), + name: puzzles.Day10.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day10.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day11), + args: args{ + year: year.String(), + name: puzzles.Day11.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day11.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day12), + args: args{ + year: year.String(), + name: puzzles.Day12.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day12.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day13), + args: args{ + year: year.String(), + name: puzzles.Day13.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day13.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day14), + args: args{ + year: year.String(), + name: puzzles.Day14.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day14.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day15), + args: args{ + year: year.String(), + name: puzzles.Day15.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day15.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day16), + args: args{ + year: year.String(), + name: puzzles.Day16.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day16.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day17), + args: args{ + year: year.String(), + name: puzzles.Day17.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day17.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day18), + args: args{ + year: year.String(), + name: puzzles.Day18.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day18.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day19), + args: args{ + year: year.String(), + name: puzzles.Day19.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day19.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day20), + args: args{ + year: year.String(), + name: puzzles.Day20.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day20.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day21), + args: args{ + year: year.String(), + name: puzzles.Day21.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day21.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day22), + args: args{ + year: year.String(), + name: puzzles.Day22.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day22.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day23), + args: args{ + year: year.String(), + name: puzzles.Day23.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day23.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day24), + args: args{ + year: year.String(), + name: puzzles.Day24.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day24.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day25), + args: args{ + year: year.String(), + name: puzzles.Day25.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day25.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + } +} diff --git a/tests/regression_2021_test.go b/tests/regression_2021_test.go new file mode 100644 index 00000000..0bcae47f --- /dev/null +++ b/tests/regression_2021_test.go @@ -0,0 +1,364 @@ +package tests_test + +import ( + "testing" + + "github.com/obalunenko/advent-of-code/internal/puzzles" +) + +func testcases2021(tb testing.TB) []testcase { + year := puzzles.Year2021 + + return []testcase{ + { + name: tcName(tb, year, puzzles.Day01), + args: args{ + year: year.String(), + name: puzzles.Day01.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day01.String(), + Part1: "1482", + Part2: "1518", + }, + wantErr: false, + }, + { + name: tcName(tb, year, puzzles.Day02), + args: args{ + year: year.String(), + name: puzzles.Day02.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day02.String(), + Part1: "1484118", + Part2: "1463827010", + }, + wantErr: false, + }, + { + name: tcName(tb, year, puzzles.Day03), + args: args{ + year: year.String(), + name: puzzles.Day03.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day03.String(), + Part1: "4103154", + Part2: "4245351", + }, + wantErr: false, + }, + { + name: tcName(tb, year, puzzles.Day04), + args: args{ + year: year.String(), + name: puzzles.Day04.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day04.String(), + Part1: "58374", + Part2: "11377", + }, + wantErr: false, + }, + { + name: tcName(tb, year, puzzles.Day05), + args: args{ + year: year.String(), + name: puzzles.Day05.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day05.String(), + Part1: "7414", + Part2: "19676", + }, + wantErr: false, + }, + { + name: tcName(tb, year, puzzles.Day06), + args: args{ + year: year.String(), + name: puzzles.Day06.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day06.String(), + Part1: "388739", + Part2: "1741362314973", + }, + wantErr: false, + }, + { + name: tcName(tb, year, puzzles.Day07), + args: args{ + year: year.String(), + name: puzzles.Day07.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day07.String(), + Part1: "348664", + Part2: "100220525", + }, + wantErr: false, + }, + { + name: tcName(tb, year, puzzles.Day08), + args: args{ + year: year.String(), + name: puzzles.Day08.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day08.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day09), + args: args{ + year: year.String(), + name: puzzles.Day09.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day09.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day10), + args: args{ + year: year.String(), + name: puzzles.Day10.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day10.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day11), + args: args{ + year: year.String(), + name: puzzles.Day11.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day11.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day12), + args: args{ + year: year.String(), + name: puzzles.Day12.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day12.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day13), + args: args{ + year: year.String(), + name: puzzles.Day13.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day13.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day14), + args: args{ + year: year.String(), + name: puzzles.Day14.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day14.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day15), + args: args{ + year: year.String(), + name: puzzles.Day15.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day15.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day16), + args: args{ + year: year.String(), + name: puzzles.Day16.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day16.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day17), + args: args{ + year: year.String(), + name: puzzles.Day17.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day17.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day18), + args: args{ + year: year.String(), + name: puzzles.Day18.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day18.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day19), + args: args{ + year: year.String(), + name: puzzles.Day19.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day19.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day20), + args: args{ + year: year.String(), + name: puzzles.Day20.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day20.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day21), + args: args{ + year: year.String(), + name: puzzles.Day21.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day21.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day22), + args: args{ + year: year.String(), + name: puzzles.Day22.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day22.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day23), + args: args{ + year: year.String(), + name: puzzles.Day23.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day23.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day24), + args: args{ + year: year.String(), + name: puzzles.Day24.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day24.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day25), + args: args{ + year: year.String(), + name: puzzles.Day25.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day25.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + } +} diff --git a/tests/regression_2022_test.go b/tests/regression_2022_test.go new file mode 100644 index 00000000..16877cbf --- /dev/null +++ b/tests/regression_2022_test.go @@ -0,0 +1,364 @@ +package tests_test + +import ( + "testing" + + "github.com/obalunenko/advent-of-code/internal/puzzles" +) + +func testcases2022(tb testing.TB) []testcase { + year := puzzles.Year2022 + + return []testcase{ + { + name: tcName(tb, year, puzzles.Day01), + args: args{ + year: year.String(), + name: puzzles.Day01.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day01.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day02), + args: args{ + year: year.String(), + name: puzzles.Day02.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day02.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day03), + args: args{ + year: year.String(), + name: puzzles.Day03.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day03.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day04), + args: args{ + year: year.String(), + name: puzzles.Day04.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day04.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day05), + args: args{ + year: year.String(), + name: puzzles.Day05.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day05.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day06), + args: args{ + year: year.String(), + name: puzzles.Day06.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day06.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day07), + args: args{ + year: year.String(), + name: puzzles.Day07.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day07.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day08), + args: args{ + year: year.String(), + name: puzzles.Day08.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day08.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day09), + args: args{ + year: year.String(), + name: puzzles.Day09.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day09.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day10), + args: args{ + year: year.String(), + name: puzzles.Day10.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day10.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day11), + args: args{ + year: year.String(), + name: puzzles.Day11.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day11.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day12), + args: args{ + year: year.String(), + name: puzzles.Day12.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day12.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day13), + args: args{ + year: year.String(), + name: puzzles.Day13.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day13.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day14), + args: args{ + year: year.String(), + name: puzzles.Day14.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day14.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day15), + args: args{ + year: year.String(), + name: puzzles.Day15.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day15.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day16), + args: args{ + year: year.String(), + name: puzzles.Day16.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day16.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day17), + args: args{ + year: year.String(), + name: puzzles.Day17.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day17.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day18), + args: args{ + year: year.String(), + name: puzzles.Day18.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day18.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day19), + args: args{ + year: year.String(), + name: puzzles.Day19.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day19.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day20), + args: args{ + year: year.String(), + name: puzzles.Day20.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day20.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day21), + args: args{ + year: year.String(), + name: puzzles.Day21.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day21.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day22), + args: args{ + year: year.String(), + name: puzzles.Day22.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day22.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day23), + args: args{ + year: year.String(), + name: puzzles.Day23.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day23.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day24), + args: args{ + year: year.String(), + name: puzzles.Day24.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day24.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + { + name: tcName(tb, year, puzzles.Day25), + args: args{ + year: year.String(), + name: puzzles.Day25.String(), + }, + want: puzzles.Result{ + Year: year.String(), + Name: puzzles.Day25.String(), + Part1: "", + Part2: "", + }, + wantErr: true, + }, + } +} diff --git a/tests/regression_test.go b/tests/regression_test.go index 573d69e6..613aed20 100644 --- a/tests/regression_test.go +++ b/tests/regression_test.go @@ -2,6 +2,7 @@ package tests_test import ( "context" + "fmt" "testing" "github.com/obalunenko/getenv" @@ -31,6 +32,8 @@ const ( // Regression tests for all puzzles. Check that answers still correct. func TestRun(t *testing.T) { + t.Parallel() + if !getenv.BoolOrDefault(regressionEnabled, false) { t.Skipf("%s disabled", regressionEnabled) } @@ -45,16 +48,21 @@ func TestRun(t *testing.T) { var tests []testcase tests = append(tests, invalid()...) - tests = append(tests, testcases2015()...) - tests = append(tests, testcases2016()...) - tests = append(tests, testcases2017()...) - tests = append(tests, testcases2018()...) - tests = append(tests, testcases2019()...) - tests = append(tests, testcases2020()...) - tests = append(tests, testcases2021()...) + tests = append(tests, testcases2015(t)...) + tests = append(tests, testcases2016(t)...) + tests = append(tests, testcases2017(t)...) + tests = append(tests, testcases2018(t)...) + tests = append(tests, testcases2019(t)...) + tests = append(tests, testcases2020(t)...) + tests = append(tests, testcases2021(t)...) + tests = append(tests, testcases2022(t)...) + + for i := range tests { + tt := tests[i] - for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() + got, err := command.Run(ctx, tt.args.year, tt.args.name) if tt.wantErr { require.Error(t, err) @@ -62,7 +70,6 @@ func TestRun(t *testing.T) { return } - require.NoError(t, err) assert.Equal(t, tt.want, got) }) } @@ -109,2501 +116,8 @@ func invalid() []testcase { } } -func testcases2015() []testcase { - year := puzzles.Year2015.String() - - return []testcase{ - { - name: "2015/day01", - args: args{ - year: year, - name: puzzles.Day01.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day01.String(), - Part1: "232", - Part2: "1783", - }, - wantErr: false, - }, - { - name: "2015/day02", - args: args{ - year: year, - name: puzzles.Day02.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day02.String(), - Part1: "1598415", - Part2: "3812909", - }, - wantErr: false, - }, - { - name: "2015/day03", - args: args{ - year: year, - name: puzzles.Day03.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day03.String(), - Part1: "2565", - Part2: "2639", - }, - wantErr: false, - }, - { - name: "2015/day04", - args: args{ - year: year, - name: puzzles.Day04.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day04.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2015/day05", - args: args{ - year: year, - name: puzzles.Day05.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day05.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2015/day06", - args: args{ - year: year, - name: puzzles.Day06.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day06.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2015/day07", - args: args{ - year: year, - name: puzzles.Day07.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day07.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2015/day08", - args: args{ - year: year, - name: puzzles.Day08.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day08.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2015/day09", - args: args{ - year: year, - name: puzzles.Day09.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day09.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2015/day10", - args: args{ - year: year, - name: puzzles.Day10.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day10.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2015/day11", - args: args{ - year: year, - name: puzzles.Day11.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day11.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2015/day12", - args: args{ - year: year, - name: puzzles.Day12.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day12.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2015/day13", - args: args{ - year: year, - name: puzzles.Day13.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day13.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2015/day14", - args: args{ - year: year, - name: puzzles.Day14.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day14.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2015/day15", - args: args{ - year: year, - name: puzzles.Day15.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day15.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2015/day16", - args: args{ - year: year, - name: puzzles.Day16.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day16.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2015/day17", - args: args{ - year: year, - name: puzzles.Day17.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day17.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2015/day18", - args: args{ - year: year, - name: puzzles.Day18.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day18.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2015/day19", - args: args{ - year: year, - name: puzzles.Day19.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day19.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2015/day20", - args: args{ - year: year, - name: puzzles.Day20.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day20.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2015/day21", - args: args{ - year: year, - name: puzzles.Day21.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day21.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2015/day22", - args: args{ - year: year, - name: puzzles.Day22.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day22.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2015/day23", - args: args{ - year: year, - name: puzzles.Day23.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day23.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2015/day24", - args: args{ - year: year, - name: puzzles.Day24.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day24.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2015/day25", - args: args{ - year: year, - name: puzzles.Day25.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day25.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - } -} - -func testcases2016() []testcase { - year := puzzles.Year2016.String() +func tcName(tb testing.TB, year puzzles.Year, day puzzles.Day) string { + tb.Helper() - return []testcase{ - { - name: "2016/day01", - args: args{ - year: year, - name: puzzles.Day01.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day01.String(), - Part1: "307", - Part2: "165", - }, - wantErr: false, - }, - { - name: "2016/day02", - args: args{ - year: year, - name: puzzles.Day02.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day02.String(), - Part1: "48584", - Part2: "563B6", - }, - wantErr: false, - }, - { - name: "2016/day03", - args: args{ - year: year, - name: puzzles.Day03.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day03.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2016/day04", - args: args{ - year: year, - name: puzzles.Day04.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day04.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2016/day05", - args: args{ - year: year, - name: puzzles.Day05.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day05.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2016/day06", - args: args{ - year: year, - name: puzzles.Day06.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day06.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2016/day07", - args: args{ - year: year, - name: puzzles.Day07.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day07.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2016/day08", - args: args{ - year: year, - name: puzzles.Day08.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day08.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2016/day09", - args: args{ - year: year, - name: puzzles.Day09.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day09.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2016/day10", - args: args{ - year: year, - name: puzzles.Day10.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day10.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2016/day11", - args: args{ - year: year, - name: puzzles.Day11.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day11.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2016/day12", - args: args{ - year: year, - name: puzzles.Day12.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day12.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2016/day13", - args: args{ - year: year, - name: puzzles.Day13.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day13.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2016/day14", - args: args{ - year: year, - name: puzzles.Day14.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day14.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2016/day15", - args: args{ - year: year, - name: puzzles.Day15.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day15.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2016/day16", - args: args{ - year: year, - name: puzzles.Day16.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day16.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2016/day17", - args: args{ - year: year, - name: puzzles.Day17.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day17.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2016/day18", - args: args{ - year: year, - name: puzzles.Day18.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day18.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2016/day19", - args: args{ - year: year, - name: puzzles.Day19.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day19.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2016/day20", - args: args{ - year: year, - name: puzzles.Day20.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day20.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2016/day21", - args: args{ - year: year, - name: puzzles.Day21.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day21.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2016/day22", - args: args{ - year: year, - name: puzzles.Day22.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day22.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2016/day23", - args: args{ - year: year, - name: puzzles.Day23.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day23.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2016/day24", - args: args{ - year: year, - name: puzzles.Day24.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day24.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2016/day25", - args: args{ - year: year, - name: puzzles.Day25.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day25.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - } -} - -func testcases2017() []testcase { - year := puzzles.Year2017.String() - - return []testcase{ - { - name: "2017/day01", - args: args{ - year: year, - name: puzzles.Day01.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day01.String(), - Part1: "1029", - Part2: "1220", - }, - wantErr: false, - }, - { - name: "2017/day02", - args: args{ - year: year, - name: puzzles.Day02.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day02.String(), - Part1: "32020", - Part2: "236", - }, - wantErr: false, - }, - { - name: "2017/day03", - args: args{ - year: year, - name: puzzles.Day03.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day03.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2017/day04", - args: args{ - year: year, - name: puzzles.Day04.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day04.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2017/day05", - args: args{ - year: year, - name: puzzles.Day05.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day05.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2017/day06", - args: args{ - year: year, - name: puzzles.Day06.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day06.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2017/day07", - args: args{ - year: year, - name: puzzles.Day07.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day07.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2017/day08", - args: args{ - year: year, - name: puzzles.Day08.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day08.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2017/day09", - args: args{ - year: year, - name: puzzles.Day09.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day09.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2017/day10", - args: args{ - year: year, - name: puzzles.Day10.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day10.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2017/day11", - args: args{ - year: year, - name: puzzles.Day11.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day11.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2017/day12", - args: args{ - year: year, - name: puzzles.Day12.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day12.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2017/day13", - args: args{ - year: year, - name: puzzles.Day13.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day13.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2017/day14", - args: args{ - year: year, - name: puzzles.Day14.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day14.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2017/day15", - args: args{ - year: year, - name: puzzles.Day15.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day15.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2017/day16", - args: args{ - year: year, - name: puzzles.Day16.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day16.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2017/day17", - args: args{ - year: year, - name: puzzles.Day17.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day17.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2017/day18", - args: args{ - year: year, - name: puzzles.Day18.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day18.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2017/day19", - args: args{ - year: year, - name: puzzles.Day19.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day19.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2017/day20", - args: args{ - year: year, - name: puzzles.Day20.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day20.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2017/day21", - args: args{ - year: year, - name: puzzles.Day21.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day21.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2017/day22", - args: args{ - year: year, - name: puzzles.Day22.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day22.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2017/day23", - args: args{ - year: year, - name: puzzles.Day23.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day23.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2017/day24", - args: args{ - year: year, - name: puzzles.Day24.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day24.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2017/day25", - args: args{ - year: year, - name: puzzles.Day25.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day25.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - } -} - -func testcases2018() []testcase { - year := puzzles.Year2018.String() - - return []testcase{ - { - name: "2018/day01", - args: args{ - year: year, - name: puzzles.Day01.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day01.String(), - Part1: "439", - Part2: "124645", - }, - wantErr: false, - }, - { - name: "2018/day02", - args: args{ - year: year, - name: puzzles.Day02.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day02.String(), - Part1: "6944", - Part2: "srijafjzloguvlntqmphenbkd", - }, - wantErr: false, - }, - { - name: "2018/day03", - args: args{ - year: year, - name: puzzles.Day03.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day03.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2018/day04", - args: args{ - year: year, - name: puzzles.Day04.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day04.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2018/day05", - args: args{ - year: year, - name: puzzles.Day05.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day05.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2018/day06", - args: args{ - year: year, - name: puzzles.Day06.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day06.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2018/day07", - args: args{ - year: year, - name: puzzles.Day07.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day07.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2018/day08", - args: args{ - year: year, - name: puzzles.Day08.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day08.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2018/day09", - args: args{ - year: year, - name: puzzles.Day09.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day09.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2018/day10", - args: args{ - year: year, - name: puzzles.Day10.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day10.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2018/day11", - args: args{ - year: year, - name: puzzles.Day11.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day11.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2018/day12", - args: args{ - year: year, - name: puzzles.Day12.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day12.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2018/day13", - args: args{ - year: year, - name: puzzles.Day13.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day13.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2018/day14", - args: args{ - year: year, - name: puzzles.Day14.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day14.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2018/day15", - args: args{ - year: year, - name: puzzles.Day15.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day15.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2018/day16", - args: args{ - year: year, - name: puzzles.Day16.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day16.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2018/day17", - args: args{ - year: year, - name: puzzles.Day17.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day17.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2018/day18", - args: args{ - year: year, - name: puzzles.Day18.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day18.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2018/day19", - args: args{ - year: year, - name: puzzles.Day19.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day19.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2018/day20", - args: args{ - year: year, - name: puzzles.Day20.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day20.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2018/day21", - args: args{ - year: year, - name: puzzles.Day21.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day21.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2018/day22", - args: args{ - year: year, - name: puzzles.Day22.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day22.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2018/day23", - args: args{ - year: year, - name: puzzles.Day23.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day23.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2018/day24", - args: args{ - year: year, - name: puzzles.Day24.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day24.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2018/day25", - args: args{ - year: year, - name: puzzles.Day25.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day25.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - } -} - -func testcases2019() []testcase { - year := puzzles.Year2019.String() - - return []testcase{ - { - name: "2019/day01", - args: args{ - year: year, - name: puzzles.Day01.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day01.String(), - Part1: "3464458", - Part2: "5193796", - }, - wantErr: false, - }, - { - name: "2019/day02", - args: args{ - year: year, - name: puzzles.Day02.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day02.String(), - Part1: "2890696", - Part2: "8226", - }, - wantErr: false, - }, - { - name: "2019/day03", - args: args{ - year: year, - name: puzzles.Day03.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day03.String(), - Part1: "1195", - Part2: "91518", - }, - wantErr: false, - }, - { - name: "2019/day04", - args: args{ - year: year, - name: puzzles.Day04.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day04.String(), - Part1: "2779", - Part2: "1972", - }, - wantErr: false, - }, - { - name: "2019/day05", - args: args{ - year: year, - name: puzzles.Day05.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day05.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2019/day06", - args: args{ - year: year, - name: puzzles.Day06.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day06.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2019/day07", - args: args{ - year: year, - name: puzzles.Day07.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day07.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2019/day08", - args: args{ - year: year, - name: puzzles.Day08.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day08.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2019/day09", - args: args{ - year: year, - name: puzzles.Day09.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day09.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2019/day10", - args: args{ - year: year, - name: puzzles.Day10.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day10.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2019/day11", - args: args{ - year: year, - name: puzzles.Day11.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day11.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2019/day12", - args: args{ - year: year, - name: puzzles.Day12.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day12.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2019/day13", - args: args{ - year: year, - name: puzzles.Day13.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day13.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2019/day14", - args: args{ - year: year, - name: puzzles.Day14.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day14.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2019/day15", - args: args{ - year: year, - name: puzzles.Day15.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day15.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2019/day16", - args: args{ - year: year, - name: puzzles.Day16.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day16.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2019/day17", - args: args{ - year: year, - name: puzzles.Day17.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day17.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2019/day18", - args: args{ - year: year, - name: puzzles.Day18.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day18.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2019/day19", - args: args{ - year: year, - name: puzzles.Day19.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day19.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2019/day20", - args: args{ - year: year, - name: puzzles.Day20.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day20.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2019/day21", - args: args{ - year: year, - name: puzzles.Day21.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day21.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2019/day22", - args: args{ - year: year, - name: puzzles.Day22.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day22.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2019/day23", - args: args{ - year: year, - name: puzzles.Day23.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day23.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2019/day24", - args: args{ - year: year, - name: puzzles.Day24.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day24.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2019/day25", - args: args{ - year: year, - name: puzzles.Day25.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day25.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - } -} - -func testcases2020() []testcase { - year := puzzles.Year2020.String() - - return []testcase{ - { - name: "2020/day01", - args: args{ - year: year, - name: puzzles.Day01.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day01.String(), - Part1: "270144", - Part2: "261342720", - }, - wantErr: false, - }, - { - name: "2020/day02", - args: args{ - year: year, - name: puzzles.Day02.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day02.String(), - Part1: "456", - Part2: "308", - }, - wantErr: false, - }, - { - name: "2020/day03", - args: args{ - year: year, - name: puzzles.Day03.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day03.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2020/day04", - args: args{ - year: year, - name: puzzles.Day04.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day04.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2020/day05", - args: args{ - year: year, - name: puzzles.Day05.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day05.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2020/day06", - args: args{ - year: year, - name: puzzles.Day06.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day06.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2020/day07", - args: args{ - year: year, - name: puzzles.Day07.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day07.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2020/day08", - args: args{ - year: year, - name: puzzles.Day08.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day08.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2020/day09", - args: args{ - year: year, - name: puzzles.Day09.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day09.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2020/day10", - args: args{ - year: year, - name: puzzles.Day10.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day10.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2020/day11", - args: args{ - year: year, - name: puzzles.Day11.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day11.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2020/day12", - args: args{ - year: year, - name: puzzles.Day12.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day12.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2020/day13", - args: args{ - year: year, - name: puzzles.Day13.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day13.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2020/day14", - args: args{ - year: year, - name: puzzles.Day14.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day14.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2020/day15", - args: args{ - year: year, - name: puzzles.Day15.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day15.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2020/day16", - args: args{ - year: year, - name: puzzles.Day16.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day16.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2020/day17", - args: args{ - year: year, - name: puzzles.Day17.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day17.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2020/day18", - args: args{ - year: year, - name: puzzles.Day18.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day18.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2020/day19", - args: args{ - year: year, - name: puzzles.Day19.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day19.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2020/day20", - args: args{ - year: year, - name: puzzles.Day20.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day20.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2020/day21", - args: args{ - year: year, - name: puzzles.Day21.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day21.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2020/day22", - args: args{ - year: year, - name: puzzles.Day22.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day22.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2020/day23", - args: args{ - year: year, - name: puzzles.Day23.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day23.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2020/day24", - args: args{ - year: year, - name: puzzles.Day24.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day24.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2020/day25", - args: args{ - year: year, - name: puzzles.Day25.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day25.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - } -} - -func testcases2021() []testcase { - year := puzzles.Year2021.String() - - return []testcase{ - { - name: "2021/day01", - args: args{ - year: year, - name: puzzles.Day01.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day01.String(), - Part1: "1482", - Part2: "1518", - }, - wantErr: false, - }, - { - name: "2021/day02", - args: args{ - year: year, - name: puzzles.Day02.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day02.String(), - Part1: "1484118", - Part2: "1463827010", - }, - wantErr: false, - }, - { - name: "2021/day03", - args: args{ - year: year, - name: puzzles.Day03.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day03.String(), - Part1: "4103154", - Part2: "4245351", - }, - wantErr: false, - }, - { - name: "2021/day04", - args: args{ - year: year, - name: puzzles.Day04.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day04.String(), - Part1: "58374", - Part2: "11377", - }, - wantErr: false, - }, - { - name: "2021/day05", - args: args{ - year: year, - name: puzzles.Day05.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day05.String(), - Part1: "7414", - Part2: "19676", - }, - wantErr: false, - }, - { - name: "2021/day06", - args: args{ - year: year, - name: puzzles.Day06.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day06.String(), - Part1: "388739", - Part2: "1741362314973", - }, - wantErr: false, - }, - { - name: "2021/day07", - args: args{ - year: year, - name: puzzles.Day07.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day07.String(), - Part1: "348664", - Part2: "100220525", - }, - wantErr: false, - }, - { - name: "2021/day08", - args: args{ - year: year, - name: puzzles.Day08.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day08.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2021/day09", - args: args{ - year: year, - name: puzzles.Day09.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day09.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2021/day10", - args: args{ - year: year, - name: puzzles.Day10.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day10.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2021/day11", - args: args{ - year: year, - name: puzzles.Day11.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day11.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2021/day12", - args: args{ - year: year, - name: puzzles.Day12.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day12.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2021/day13", - args: args{ - year: year, - name: puzzles.Day13.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day13.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2021/day14", - args: args{ - year: year, - name: puzzles.Day14.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day14.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2021/day15", - args: args{ - year: year, - name: puzzles.Day15.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day15.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2021/day16", - args: args{ - year: year, - name: puzzles.Day16.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day16.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2021/day17", - args: args{ - year: year, - name: puzzles.Day17.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day17.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2021/day18", - args: args{ - year: year, - name: puzzles.Day18.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day18.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2021/day19", - args: args{ - year: year, - name: puzzles.Day19.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day19.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2021/day20", - args: args{ - year: year, - name: puzzles.Day20.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day20.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2021/day21", - args: args{ - year: year, - name: puzzles.Day21.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day21.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2021/day22", - args: args{ - year: year, - name: puzzles.Day22.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day22.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2021/day23", - args: args{ - year: year, - name: puzzles.Day23.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day23.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2021/day24", - args: args{ - year: year, - name: puzzles.Day24.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day24.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - { - name: "2021/day25", - args: args{ - year: year, - name: puzzles.Day25.String(), - }, - want: puzzles.Result{ - Year: year, - Name: puzzles.Day25.String(), - Part1: "", - Part2: "", - }, - wantErr: true, - }, - } + return fmt.Sprintf("%s/%s", year.String(), day.String()) }