rubyx/test/fragments/test_functions.rb

35 lines
424 B
Ruby
Raw Normal View History

require_relative 'helper'
class TestFunctions < MiniTest::Test
include Fragments
2014-05-28 13:27:18 +02:00
def test_functions
@string_input = <<HERE
def minus(a,b)
2015-07-19 11:33:33 +02:00
a - b
end
2015-07-19 10:15:38 +02:00
def plus(a, b)
a + b
end
def times(a, b)
if( b == 0 )
a = 0
else
m = minus(b, 1)
t = times(a, m)
a = plus(a,t)
end
end
2014-06-07 22:22:32 +02:00
def t_seven()
tim = times(7,6)
tim.putint()
end
t_seven()
HERE
2015-07-19 10:15:38 +02:00
@expect = [Virtual::Return ]
check
end
end