From b281be27e5a03d09dcec8051309ae00365758915 Mon Sep 17 00:00:00 2001 From: Jeff Kantarek <10119570+jkantarek@users.noreply.github.com> Date: Mon, 4 Dec 2023 19:12:28 -0600 Subject: [PATCH] [DEV] add sample* methods to make testing easier (#19) --- lib/mix/tasks/day.eex | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/mix/tasks/day.eex b/lib/mix/tasks/day.eex index 6ce5809..0836b10 100644 --- a/lib/mix/tasks/day.eex +++ b/lib/mix/tasks/day.eex @@ -19,12 +19,12 @@ defmodule AdventOfCode.Y<%= year %>.Day<%= day %> do """ def sample() do - setup("test_input.txt") + part1("test_input.txt") end - def part1() do - setup("input.txt") + def part1(filename \\ "input.txt") do + setup(filename) end def decoder(line) do @@ -48,9 +48,17 @@ defmodule AdventOfCode.Y<%= year %>.Day<%= day %> do iex> AdventOfCode.Y<%= year %>.Day<%= day %>.part2() nil + iex> AdventOfCode.Y<%= year %>.Day<%= day %>.sample2() + nil + """ - def part2() do + def sample2() do + part2("test_input.txt") + end + + def part2(filename \\ "input.txt") do + setup(filename) end end