rubyx/test/compiler/fragments/test_recursive_fibo.rb

34 lines
529 B
Ruby
Raw Normal View History

require_relative 'helper'
class TestRecursinveFibo < MiniTest::Test
include Fragments
def test_recursive_fibo
@string_input = <<HERE
2015-10-07 09:04:55 +02:00
class Object
int fibonaccir( int n )
2015-10-27 10:00:48 +01:00
if_plus( n - 1 )
int tmp
tmp = n - 1
int a = fibonaccir( tmp )
tmp = n - 2
int b = fibonaccir( tmp )
return a + b
2015-10-27 10:00:48 +01:00
else
return n
end
end
2015-10-07 09:04:55 +02:00
int fib_print(int n)
int fib = fibonaccir( n )
fib.putint()
end
int main()
fib_print(10)
2015-09-20 15:52:26 +02:00
end
end
HERE
2015-10-27 10:00:48 +01:00
@length = 71
2015-07-19 12:31:13 +02:00
check
end
end