rubyx/test/risc/interpreter/blocks/test_dyn_call.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

30 lines
700 B
Ruby

require_relative "../helper"
module Risc
class BlockCallDyn < MiniTest::Test
include Ticker
def setup
@preload = "Integer.div4"
@string_input = block_main("a = tenner {|b| return b.div4} ; return a" , tenner)
super
end
def test_chain
#show_main_ticks # get output of what is
run_all
assert_equal 2 , get_return , "10.div4"
end
end
class BlockCallArgOpDyn < MiniTest::Test
include Ticker
def setup
@preload = "Integer.mul"
@string_input = block_main("a = tenner {|b| return b*b} ; return a" , tenner)
super
end
def test_chain
run_all
assert_equal 100 , get_return , "10*10"
end
end
end