rubyx/test/fragments/test_recursive_fibo.rb

30 lines
451 B
Ruby
Raw Normal View History

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