update tests

This commit is contained in:
2026-06-05 18:26:17 +10:00
parent 8622d80f86
commit 3a3176a463
2 changed files with 11 additions and 8 deletions

View File

@@ -21,6 +21,7 @@ struct OtherStruct : Foo {
}
func main() -> int {
OtherStruct test = new OtherStruct(3)
return test.testFunc()
Foo test = new Foo(3)
OtherStruct test2 = new OtherStruct(3)
return test.testFunc() + test2.testFunc()
}

View File

@@ -1,3 +1,5 @@
import io
struct Vector {
int x = 0
int y = 0
@@ -18,25 +20,25 @@ struct Vector {
struct Child : Vector {
init(int x, int y, int z) {
super(self, x, y, z)
}
override func add(Vector other) -> void {
print("overwritten!\n")
io.print("overwritten!\n")
}
}
func main() -> int {
Vector myVector = new Vector(1, 2, 3)
print("myVector.x = %d, myVector.y = %d, myVector.z = %d\n", myVector.x, myVector.y, myVector.z)
io.print("myVector.x = %d, myVector.y = %d, myVector.z = %d\n", myVector.x, myVector.y, myVector.z)
myVector.add(new Vector(1, 2, 3))
print("myVector.x = %d, myVector.y = %d, myVector.z = %d\n", myVector.x, myVector.y, myVector.z)
io.print("myVector.x = %d, myVector.y = %d, myVector.z = %d\n", myVector.x, myVector.y, myVector.z)
print("test\n")
io.print("test\n")
Child myChildVector = new Child(1, 2, 3)
print("test 2\n")
io.print("test 2\n")
myChildVector.add(new Vector(1, 2, 3))