rubyx/test/risc/interpreter/blocks/test_while.rb
Torsten Rüger 12b29285d7 Lots of preloading for tests
so many relied (implicitly( on some builtin function
after all can't do much in ruby without calling
Now all those dependencies are explicit
Small risc changes come because the macro version has a return label and unreachable label
2019-09-13 14:07:12 +03:00

21 lines
479 B
Ruby

require_relative "../helper"
module Risc
class BlockWhile < MiniTest::Test
include Ticker
def setup
@preload = "Integer.gt;Integer.minus"
@string_input = block_main("a = tenner {|b| #{while_str} } ; return a" , tenner)
super
end
def while_str
"while( b > 5); b = b - 1 ;end;return b"
end
def test_chain
#show_main_ticks # get output of what is
run_all
assert_equal 5 , get_return , while_str
end
end
end