X-Git-Url: https://ocean-lang.org/code/?p=ocean;a=blobdiff_plain;f=csrc%2Foceani-tests.mdc;h=f9dce403d3e83f9920736e06853676778bfd7198;hp=d1557010e9c03d1cd27b895ace23989ef6227ff0;hb=f34d3718d70bd38d10eeeb1bb42d0f3e2e6c978b;hpb=ef3bbba20f9e426125498f78fe3b1f4ea75de68a diff --git a/csrc/oceani-tests.mdc b/csrc/oceani-tests.mdc index d155701..f9dce40 100644 --- a/csrc/oceani-tests.mdc +++ b/csrc/oceani-tests.mdc @@ -134,6 +134,15 @@ calculations on them. + b1 + b + z:Boolean= True + w:Boolean = False + if ?z: + print "w??z", w??z + print "z??w", z??w + print "z??False", z??False, "w??False", w??False + if ?w: + print "Weird?" + ###### output: valvar 23 12 35 11 276 1.916666667 11 @@ -142,6 +151,9 @@ calculations on them. False True True False False False This is a string field theory This is a string field theory 81 + w??z True + z??w True + z??False True w??False False Next we change the value of variables @@ -794,7 +806,7 @@ These programs were generated by looking for the various places that `type_err()` are called. ###### test list - oceani_failing_tests += type_err1 type_err2 type_err3 type_err4 type_err5 + oceani_failing_tests += type_err1 type_err2 type_err3 type_err4 type_err5 type_err6 ###### test: type_err1 @@ -939,6 +951,20 @@ various places that `type_err()` are called. .tmp.code:2:7: error: type has recursive definition: foo .tmp.code:5:7: error: type has recursive definition: baz +###### test: type_err6 + + func main() + a:= "hello" + if ?a: + print "no" + print a ?? "there" + +###### output: type_err6 + .tmp.code:4:12: error: '?' requires a testable value, not string + .tmp.code:6:14: error: "??" requires a testable value, not string + oceani: type error in program - not running. + + ###### test list oceani_failing_tests += type_err_const type_err_const1 type_err_const2 missing_program bad_main