A fork of Crisp for HARP
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

40 lines
659 B

class MalTestRunner
def initialize(@test_file)
end
macro check_EOF
return if l.is_a? Iterator::Stop
end
def each_test
lines = File.open(@test_file).each_line
until (l = lines.next).is_a? Iterator::Stop
while l =~ /^\s*(;|$)/
l = lines.next
check_EOF
end
check_EOF
input = l
output = [] of String
loop do
l = lines.next
check_EOF
if l =~ /^; /
output << l[2..-1]
else
break
end
end
if l =~ /^;=>/
yield input, output, l[3..-1]
else
yield input, output, nil
end
end
end
end