22 lines
370 B
Ruby
22 lines
370 B
Ruby
|
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
|