X-Git-Url: https://ocean-lang.org/code/?p=ocean;a=blobdiff_plain;f=csrc%2Foceani-tests.mdc;h=3156b3d4bcd372babc885c6a658d9382e5d1d53f;hp=1d7282da7f95babcfc8a342f48ff1748c19da9b4;hb=50d5f6884a6c99e771b4907a03062955e7edbab5;hpb=0897423423ea2704abdfd35dc58065d12d9f7386 diff --git a/csrc/oceani-tests.mdc b/csrc/oceani-tests.mdc index 1d7282d..3156b3d 100644 --- a/csrc/oceani-tests.mdc +++ b/csrc/oceani-tests.mdc @@ -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