]> ocean-lang.org Git - ocean/blobdiff - csrc/oceani-tests.mdc
oceani: free variables as soon as they go out of scope.
[ocean] / csrc / oceani-tests.mdc
index 6be6a153f008e7e3f1300e592c7ea3f3d69ef350..dccfb2a47bc2bdb50f7f3a39e7c3adf09ccf1b01 100644 (file)
@@ -80,7 +80,7 @@ arguments separated from the name by commas.  For each test, there is a section
                @mv *.gcov coverage ; [ -f .gcov ] && mv .gcov coverage || true
                @ awk '/NOTEST/ { next } /^ *[1-9]/ {ran+=1} /^ *###/ {skip+=1} \
                    END {printf "coverage: %6.2f%%\n", ran * 100 / (ran + skip); \
-                        if (ran < (ran + skip) *0.956) exit(1) }' \
+                        if (ran < (ran + skip) *0.959) exit(1) }' \
                        coverage/oceani.mdc.gcov
                @rm -f .tmp*
 
@@ -193,7 +193,7 @@ Test merging of variables from multiple cases
                for i:=0; then i=i+1; while i < 5:
                        switch i:
                                case 0: num:="zero"
-                               case 1: num:="one"
+                               case 1: scratch:=42; num:="one"
                                case 2: num:="two"
                                case 3: num:="three"
                                else    num:="many"
@@ -331,6 +331,7 @@ Here I break it into two parts, keeping the array code separate.
                a : number
                a = A;
                b:number = B
+               print "still", bigger // check for regression in scoping
                if a > 0 and b > 0:
                        while a != b:
                                if a < b:
@@ -386,6 +387,7 @@ Here I break it into two parts, keeping the array code separate.
        Hello World, what lovely oceans you have!
        Is 55 bigger than 33 ?  yes
        double 33 is 66
+       still yes
        GCD of 55 and 33 is 11
        Fibonacci: 1 1 2 3 5 8 13 21 34 55 89 144
        hello was the str
@@ -395,6 +397,7 @@ Here I break it into two parts, keeping the array code separate.
        Hello World, what lovely oceans you have!
        Is 12 bigger than 60 ?  no
        double 60 is 120
+       still no
        GCD of 12 and 60 is 12
        Fibonacci: 1 1 2 3 5 8 13 21 34 55 89 144
        I found the str over there