Skip to content

Commit

Permalink
[DEV] add sample* methods to make testing easier (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkantarek authored Dec 5, 2023
1 parent 5ce2446 commit b281be2
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions lib/mix/tasks/day.eex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit b281be2

Please sign in to comment.