Removing preloads from mains tests
Instead of loading all preload for all tests, adding just those functions that are needed for each. Should reduce test times. Also renaming tests to give some indication of difficulty. Alas they are not run in that order.
This commit is contained in:
28
test/mains/source/33_recurse-fibo__5.rb
Normal file
28
test/mains/source/33_recurse-fibo__5.rb
Normal file
@ -0,0 +1,28 @@
|
||||
class Integer < Data4
|
||||
def <(right)
|
||||
X.comparison(:<)
|
||||
end
|
||||
def +(right)
|
||||
X.int_operator(:+)
|
||||
end
|
||||
def -(right)
|
||||
X.int_operator(:-)
|
||||
end
|
||||
end
|
||||
|
||||
class Space
|
||||
|
||||
def fibo_r( n )
|
||||
if( n < 2 )
|
||||
return n
|
||||
else
|
||||
a = fibo_r(n - 1)
|
||||
b = fibo_r(n - 2)
|
||||
return a + b
|
||||
end
|
||||
end
|
||||
|
||||
def main(arg)
|
||||
return fibo_r(5)
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user