aoc-helper/app/templates/test.rb

22 lines
370 B
Ruby
Raw Normal View History

2022-12-02 18:57:54 +01:00
require_relative "impl"
INPUT = <<~IN
%example_input%
IN
RESULT = %example_result%
def test_example
parsed = parse(INPUT)
result = calculate(parsed)
if result == RESULT
puts "Test successful. Now run with real input"
puts "ruby %day_name%/run.rb"
else
puts "Test failed"
puts "expected \"#{RESULT}\" got \"#{result}\""
end
end
test_example