]> Nishi Git Mirror - gwion.git/commitdiff
:white_check_mark: Add test
authorfennecdjay <fennecdjay@gmail.com>
Wed, 29 Jun 2022 23:08:31 +0000 (01:08 +0200)
committerfennecdjay <fennecdjay@gmail.com>
Wed, 29 Jun 2022 23:08:31 +0000 (01:08 +0200)
tests/fptr/fptr_cast.gw [new file with mode: 0644]
tests/tree/inherit_func.gw [new file with mode: 0644]

diff --git a/tests/fptr/fptr_cast.gw b/tests/fptr/fptr_cast.gw
new file mode 100644 (file)
index 0000000..a79971c
--- /dev/null
@@ -0,0 +1,3 @@
+\ a { return 2; }(2);
+(\ a { return 2; } $ (int(int)));
+#!\ a { return 2; }(3);
diff --git a/tests/tree/inherit_func.gw b/tests/tree/inherit_func.gw
new file mode 100644 (file)
index 0000000..02e7536
--- /dev/null
@@ -0,0 +1,14 @@
+#! [contains] baz
+
+#! check that functions are called from the vtable
+
+class C {
+  fun void foo() { <<< "bar" >>>; }
+}
+
+class D extends C{
+  fun void foo() { <<< "baz" >>>; }
+}
+
+var D d;
+d.foo();