5f7683efcf
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
32 lines
497 B
Ruby
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
|