2014-05-25 07:43:07 +02:00
|
|
|
require_relative 'helper'
|
|
|
|
|
|
|
|
class TestFunctions < MiniTest::Test
|
|
|
|
include Fragments
|
|
|
|
|
2014-05-28 13:27:18 +02:00
|
|
|
def test_functions
|
2014-05-25 07:43:07 +02:00
|
|
|
@string_input = <<HERE
|
2015-10-05 23:27:13 +02:00
|
|
|
class Object
|
2015-09-20 15:30:07 +02:00
|
|
|
|
2015-10-05 23:27:13 +02:00
|
|
|
int times(int a, int b)
|
2015-10-27 10:00:48 +01:00
|
|
|
if_zero( b )
|
2015-10-05 23:27:13 +02:00
|
|
|
a = 0
|
|
|
|
else
|
2015-10-27 10:00:48 +01:00
|
|
|
int m = b - 1
|
2015-10-05 23:27:13 +02:00
|
|
|
int t = times(a, m)
|
2015-10-27 10:00:48 +01:00
|
|
|
a = a + t
|
2015-10-05 23:27:13 +02:00
|
|
|
end
|
2015-10-27 10:00:48 +01:00
|
|
|
return a
|
2015-10-05 23:27:13 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
int t_seven()
|
2015-10-27 10:00:48 +01:00
|
|
|
int tim = times(5,3)
|
2015-10-05 23:27:13 +02:00
|
|
|
tim.putint()
|
|
|
|
end
|
2014-06-07 22:22:32 +02:00
|
|
|
|
2015-10-05 23:27:13 +02:00
|
|
|
int main()
|
2015-10-27 10:00:48 +01:00
|
|
|
return t_seven()
|
2015-10-05 23:27:13 +02:00
|
|
|
end
|
|
|
|
end
|
2014-05-25 07:43:07 +02:00
|
|
|
HERE
|
2015-10-27 15:21:11 +01:00
|
|
|
@length = 191
|
2015-07-19 10:15:38 +02:00
|
|
|
check
|
|
|
|
|
2014-05-25 07:43:07 +02:00
|
|
|
end
|
|
|
|
end
|