X-Git-Url: https://ocean-lang.org/code/?p=ocean;a=blobdiff_plain;f=csrc%2Foceani-tests.mdc;h=c13a9d173a5f0d876a500791f05fe2630023f073;hp=359c8e504675d0dc36ceed1f4a0f880da8130d26;hb=e4967da39aff091cd9dfa187cf77c84ba8643293;hpb=272629ad8689864feba7ae632e838c37c81b6f9f diff --git a/csrc/oceani-tests.mdc b/csrc/oceani-tests.mdc index 359c8e5..c13a9d1 100644 --- a/csrc/oceani-tests.mdc +++ b/csrc/oceani-tests.mdc @@ -167,6 +167,7 @@ Now some contants ###### test: consts const + tau ::= pi * 2 pi ::= 3.141 592 653 four ::= 2 + 2 ; five ::= 10/2 const pie ::= "I like Pie"; @@ -176,12 +177,12 @@ Now some contants func main() print "Hello World, what lovely oceans you have!" print "are there", five, "?" - print pi, pie, "but", cake + print pi, pie, "but", cake, "Tau is", tau ###### output: consts Hello World, what lovely oceans you have! are there 5 ? - 3.141592653 I like Pie but The cake is a lie + 3.141592653 I like Pie but The cake is a lie Tau is 6.283185306 Test merging of variables from multiple cases @@ -921,7 +922,7 @@ various places that `type_err()` are called. oceani: type error in program - not running. ###### test list - oceani_failing_tests += type_err_const type_err_const1 missing_program bad_main + oceani_failing_tests += type_err_const type_err_const1 type_err_const2 missing_program bad_main ###### test: type_err_const const @@ -961,6 +962,15 @@ various places that `type_err()` are called. .tmp.code:3:12: Syntax error in constant: : .tmp.code:4:12: Syntax error in constant: : +###### test: type_err_const2 + const + four ::= two + two + two ::= four / 2 + +###### output: type_err_const2 + .tmp.code:3:8: error: const four cannot be resolved. + .tmp.code:4:8: error: const two cannot be resolved. + ###### test: missing_program const foo::="bar"