rubyx/test/fragments/test_recursive_fibo.rb

36 lines
560 B
Ruby
Raw Normal View History

require_relative 'helper'
class TestRecursinveFibo < MiniTest::Test
include Fragments
def test_recursive_fibo
@string_input = <<HERE
class Integer
int fib_print(int n)
int fib = fibonaccir( n )
fib.putint()
end
int fibonaccir( int n )
if( n <= 1 )
return n
else
int tmp
tmp = n - 1
int a = fibonaccir( tmp )
tmp = n - 2
int b = fibonaccir( tmp )
return a + b
end
end
2014-06-07 23:56:40 +02:00
end
class Object
int main()
fib_print(10)
2015-09-20 15:52:26 +02:00
end
end
HERE
2015-07-19 12:31:13 +02:00
@expect = [Virtual::Return ]
check
end
end