]> ocean-lang.org Git - ocean/blobdiff - csrc/oceani-tests.mdc
oceani: test UNTESTED parsing of structures
[ocean] / csrc / oceani-tests.mdc
index 4e9f4e388ea123f0c457c97830f6818df8db799f..0b7c76a726ca8ecc66ee4d68efb9f6f09dc43728 100644 (file)
@@ -609,6 +609,11 @@ Time to test if structure declarations and accesses work correctly.
                active:Boolean = True
 
        struct baz { a:number; b:Boolean; }
+       struct bat {
+               a:string
+               b:Boolean
+       }
+       struct bat2 a:string; b:Boolean
 
        func main
        do
@@ -629,6 +634,8 @@ Time to test if structure declarations and accesses work correctly.
                for i:=0; then i=i+1; while i < 4:
                        print info[i].name, info[i].active, info[i].size[0]
                info[0].thing.b = True
+               x:bat
+               x.a = "Hello"
 
 ###### output: structs
 
@@ -686,6 +693,15 @@ Test functions.  They don't return anything, so we need to get them to print
                angular := to_polar(32, 23)
                print angular.rho, angular.theta
 
+       func test2(n:number; s:string;) : (ret:number)
+               ret = n + $s
+
+       func random
+       return
+               n:number
+       do
+               n = 4 // xkcd:221
+
 ###### output: functions
        done
        1  done