X-Git-Url: https://ocean-lang.org/code/?a=blobdiff_plain;f=csrc%2Foceani-tests.mdc;h=fafb78821b76d5d1891cf1a630ad8896ef918a11;hb=631d5279eef7fe755d9df27ce16b416ba976154b;hp=0b7c76a726ca8ecc66ee4d68efb9f6f09dc43728;hpb=c149917d5ddbdc64113f429a6c9c531fdc47c450;p=ocean diff --git a/csrc/oceani-tests.mdc b/csrc/oceani-tests.mdc index 0b7c76a..fafb788 100644 --- a/csrc/oceani-tests.mdc +++ b/csrc/oceani-tests.mdc @@ -295,6 +295,19 @@ Now we need to test if/else and some different loops else print 'larger' + // different parsing options + for { + x:=1; sum := 0 + } then { + x = x + 1 + } while { + use x < 10 + } do { + sum = sum + x + } case 1 { + print "impossible" + } + ###### output: cond_loop Success 1 2 4 8 16 32 64 @@ -702,6 +715,13 @@ Test functions. They don't return anything, so we need to get them to print do n = 4 // xkcd:221 + // exercise the parsing options + func t1 (a:number) { + print "t1" + } + func t2 (a:string) {print "string"} + func t3() print "t3" + ###### output: functions done 1 done