new field def compiles, fix test

This commit is contained in:
Torsten Ruger
2015-09-20 16:30:07 +03:00
parent bc70c1efe5
commit f2fc9c5f89
5 changed files with 35 additions and 14 deletions

View File

@ -1,7 +1,7 @@
require_relative "test_foo"
require_relative "test_if"
#require_relative "test_functions"
require_relative "test_functions"
#require_relative "test_string_class"
#require_relative "test_hello"
#require_relative "test_putint"

View File

@ -5,23 +5,26 @@ class TestFunctions < MiniTest::Test
def test_functions
@string_input = <<HERE
def minus(a,b)
a - b
int minus(int a,int b)
return a - b
end
def plus(a, b)
a + b
int plus(int a, int b)
return a + b
end
def times(a, b)
int times(int a, int b)
if( b == 0 )
a = 0
else
m = minus(b, 1)
t = times(a, m)
int m = minus(b, 1)
int t = times(a, m)
a = plus(a,t)
end
end
def t_seven()
tim = times(7,6)
int t_seven()
int tim = times(7,6)
tim.putint()
end