X-Git-Url: https://ocean-lang.org/code/?p=ocean;a=blobdiff_plain;f=csrc%2Foceani-tests.mdc;h=11c3f19ffcd93a4c8760d9cbe85a3505befd46ae;hp=87b0206261b46ee68ff1959c776a1e732f284cdd;hb=85e747e065a6f4b2236acc8b3a2471de4d831c95;hpb=710bd5e34f120ccc520d60839420603772408a0f diff --git a/csrc/oceani-tests.mdc b/csrc/oceani-tests.mdc index 87b0206..11c3f19 100644 --- a/csrc/oceani-tests.mdc +++ b/csrc/oceani-tests.mdc @@ -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.9469) exit(1) }' \ + if (ran < (ran + skip) *0.9495) exit(1) }' \ coverage/oceani.mdc.gcov @rm -f .tmp* @@ -198,8 +198,21 @@ Test merging of variables from multiple cases print num,", ", print + for i:=0; then i=i+1; while i < 5: + switch i: + case 0: num:="zero" + case 1: num:="one" + case 2: num:="two" + case 3: num:="three" + else num:="many" + // re-declare a CondScope variable + num := i*i + print num,", ", + print + ###### output: varmerge zero , one , two , three , many , + 0 , 1 , 4 , 9 , 16 , ## Conditions and Loops