]> ocean-lang.org Git - ocean/blobdiff - csrc/oceani-tests.mdc
oceani: support functions returning multiple values.
[ocean] / csrc / oceani-tests.mdc
index 1d7282da7f95babcfc8a342f48ff1748c19da9b4..3156b3d4bcd372babc885c6a658d9382e5d1d53f 100644 (file)
@@ -97,7 +97,7 @@ arguments separated from the name by commas.  For each test, there is a section
                ## valgrind test code
                @[ -n "$$SKIP_COVERAGE_CHECK" ] || awk '/NOTEST/ { next } /^ *[1-9]/ {ran+=1} /^ *###/ {skip+=1} \
                    END {printf "coverage: %6.2f%%\n", ran * 100 / (ran + skip); \
-                        if (ran < (ran + skip) *0.973) exit(1) }' \
+                        if (ran < (ran + skip) *0.972) exit(1) }' \
                        coverage/oceani.mdc.gcov
 
        coverage_oceani: oceani.c
@@ -647,9 +647,21 @@ Test functions.  They don't return anything, so we need to get them to print
                        test(n-1, "."++s)
                else
                        print "done"
+
+       func to_polar
+               x:number; y:number
+       return
+               rho:number
+               theta:number
+       do
+               rho = x + y
+               theta = x - y
+
        func main()
                for i:=0; then i = i + 1; while i < 5:
                        test(i, " ")
+               angular := to_polar(32, 23)
+               print angular.rho, angular.theta
 
 ###### output: functions
        done
@@ -657,6 +669,7 @@ Test functions.  They don't return anything, so we need to get them to print
        2  1 . done
        3  2 . 1 .. done
        4  3 . 2 .. 1 ... done
+       55 9
 
 ###### test: func_ret_type