X-Git-Url: https://ocean-lang.org/code/?p=ocean;a=blobdiff_plain;f=csrc%2Foceani-tests.mdc;h=2ac2f56d620a67ce6883cb3518a7a022298e64e9;hp=655a2c95057a3cc686ddac87003acc10bbb88e91;hb=90e73c9514fc2dfbf7a88e7ce050f9b08a5c600a;hpb=6e9a6bc829c370f60148deb155c3952edc6895f2 diff --git a/csrc/oceani-tests.mdc b/csrc/oceani-tests.mdc index 655a2c9..2ac2f56 100644 --- a/csrc/oceani-tests.mdc +++ b/csrc/oceani-tests.mdc @@ -382,19 +382,19 @@ Here I break it into two parts, keeping the array code separate. while mid := (lo + hi) / 2 if mid == target: - use Found + use .Found if mid < target: lo = mid else hi = mid if hi - lo < 1: lo = mid - use GiveUp + use .GiveUp use True do pass - case Found: + case .Found: print "Yay, I found", target - case GiveUp: + case .GiveUp: print "Closest I found was", lo ###### output: sayhello,55,33,hello,True @@ -874,6 +874,7 @@ various places that `type_err()` are called. b = b + 1 if 3 * 4 and not True: print "Weird" + d:number = .fred ###### output: type_err1 .tmp.code:3:25: error: expected string found number @@ -883,6 +884,8 @@ various places that `type_err()` are called. .tmp.code:6:8: error: Cannot assign to a constant: b .tmp.code:5:8: info: name was defined as a constant here .tmp.code:8:11: error: Arithmetic returns number but Boolean expected + .tmp.code:9:20: error: expected number found label + .tmp.code:9:8: info: variable 'd' was set as number here. oceani: type error in program - not running. ###### test: type_err2