aoc2023/day_6/test.rb

29 lines
468 B
Ruby
Raw Normal View History

2023-12-10 21:28:20 +01:00
if ARGV[0] == "2"
require_relative "impl_2"
RESULT = 71503
else
require_relative "impl"
RESULT = 288
end
INPUT = <<~IN
Time: 7 15 30
Distance: 9 40 200
IN
def test_example
parsed = parse(INPUT)
result = calculate(parsed)
if result == RESULT
puts "Test successful. Now run with real input"
puts "ruby day_6/run.rb #{ARGV[0]}"
else
puts "Test failed"
puts "expected \"#{RESULT}\" got \"#{result}\""
end
end
test_example