A fork of Crisp for HARP
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

40 lines
667 B

class MalTestRunner
def initialize(@test_file)
end
private 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