2018-04-26 11:33:33 +02:00
|
|
|
require_relative 'helper'
|
|
|
|
|
|
|
|
module Methods
|
|
|
|
class TestCallSimple < MethodsTest
|
|
|
|
|
2018-04-27 20:56:41 +02:00
|
|
|
def test_simple
|
2018-04-26 11:33:33 +02:00
|
|
|
run_space <<HERE
|
2018-04-27 20:56:41 +02:00
|
|
|
def same( n )
|
2018-04-26 11:33:33 +02:00
|
|
|
return n
|
|
|
|
end
|
|
|
|
def main(arg)
|
2018-04-27 20:56:41 +02:00
|
|
|
return same(8)
|
2018-04-26 11:33:33 +02:00
|
|
|
end
|
|
|
|
HERE
|
2018-06-19 17:55:47 +02:00
|
|
|
assert_equal 8 , get_return
|
2018-04-26 11:33:33 +02:00
|
|
|
end
|
2018-04-27 20:56:41 +02:00
|
|
|
|
|
|
|
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
|
2018-06-19 17:55:47 +02:00
|
|
|
assert_equal 7 , get_return
|
2018-04-27 20:56:41 +02:00
|
|
|
end
|
2018-04-26 11:33:33 +02:00
|
|
|
end
|
|
|
|
end
|