rubyx/test/risc/methods/test_call_simple.rb
Torsten Ruger 5f7683efcf pass return integer back out through exit
for testing of binaries later (and off course general correctness)
Some tests were using the fact that the interpreter was used, changed those to return ints rather than strings
2018-06-19 18:55:47 +03:00

32 lines
497 B
Ruby

require_relative 'helper'
module Methods
class TestCallSimple < MethodsTest
def test_simple
run_space <<HERE
def same( n )
return n
end
def main(arg)
return same(8)
end
HERE
assert_equal 8 , get_return
end
def test_call_with_call
run_space <<HERE
def same( n )
return n
end
def main(arg)
a = same(8 - 1)
return a
end
HERE
assert_equal 7 , get_return
end
end
end