summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2023-05-17 22:40:53 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2023-05-17 22:40:53 +0200
commitdef1415ee1f35e4615adfd1c503fc445bbbbe02b (patch)
tree73b1c0f8e3f4c00a568e0b3a2cd9e6683e8a7ed7
parent6abafafe48f304cb04cb1fde604b282cbb6fcffb (diff)
downloadvala-main.tar.gz
tests: Add more method tests to increase coverageHEADstagingmain
-rw-r--r--tests/Makefile.am2
-rw-r--r--tests/semantic/method-override-no-class.test14
-rw-r--r--tests/semantic/method-virtual-no-class-or-interface.test11
3 files changed, 27 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index daf2a8cf9..4596d5310 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1234,6 +1234,7 @@ TESTS = \
semantic/method-main-inline.test \
semantic/method-main-throws.test \
semantic/method-override.test \
+ semantic/method-override-no-class.test \
semantic/method-postcondition.test \
semantic/method-precondition.test \
semantic/method-private-abstract.test \
@@ -1249,6 +1250,7 @@ TESTS = \
semantic/method-too-many-type-arguments.test \
semantic/method-virtual.test \
semantic/method-virtual-body.test \
+ semantic/method-virtual-no-class-or-interface.test \
semantic/methodcall-field-initializer-throws.test \
semantic/methodcall-invalid-argument-lambda.test \
semantic/methodcall-invocation-invalid.test \
diff --git a/tests/semantic/method-override-no-class.test b/tests/semantic/method-override-no-class.test
new file mode 100644
index 000000000..f881aa4ea
--- /dev/null
+++ b/tests/semantic/method-override-no-class.test
@@ -0,0 +1,14 @@
+Invalid Code
+
+class Foo {
+ public virtual void foo () {
+ }
+}
+
+interface Bar : Foo {
+ public override void foo () {
+ }
+}
+
+void main () {
+}
diff --git a/tests/semantic/method-virtual-no-class-or-interface.test b/tests/semantic/method-virtual-no-class-or-interface.test
new file mode 100644
index 000000000..6b1161fe1
--- /dev/null
+++ b/tests/semantic/method-virtual-no-class-or-interface.test
@@ -0,0 +1,11 @@
+Invalid Code
+
+struct Foo {
+ public int i;
+
+ public virtual void foo () {
+ }
+}
+
+void main () {
+}