]> ocean-lang.org Git - ocean/blobdiff - csrc/oceani-tests.mdc
oceani: implement struct field initialisation properly.
[ocean] / csrc / oceani-tests.mdc
index e7e9f22486df6bdac410d996b2d7de05f7bd4e1b..d5541e9c3e21ea27ddb418d666789d8062c60beb 100644 (file)
@@ -555,7 +555,7 @@ Time to test if structure declarations and accesses work correctly.
        struct foo
                size:[three]number
                name:string
-               active:Boolean
+               active:Boolean = True
 
        struct baz { a:number; b:Boolean; }
 
@@ -571,7 +571,8 @@ Time to test if structure declarations and accesses work correctly.
 
                        info[i].name = nm
                        info[i].size[0] = i*i
-                       info[i].active = nm == "jane"
+                       if nm != "jane":
+                               info[i].active = False
 
                for i:=0; then i=i+1; while i < 4:
                        print info[i].name, info[i].active, info[i].size[0]