[vala/staging] test: Add some "method-call" tests to increase coverage



commit fa5175458874e89b2addb08c3a78911e9f42f39e
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Tue Nov 26 14:31:20 2019 +0100

    test: Add some "method-call" tests to increase coverage

 tests/Makefile.am                                           |  4 ++++
 tests/semantic/methodcall-field-initializer-throws.test     | 12 ++++++++++++
 tests/semantic/methodcall-void-expression.test              |  8 ++++++++
 tests/semantic/methodcall-yield-with-begin.test             | 11 +++++++++++
 tests/semantic/objectcreation-field-initializer-throws.test | 13 +++++++++++++
 5 files changed, 48 insertions(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 8448e1002..db87cf3fe 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -784,7 +784,11 @@ TESTS = \
        semantic/method-too-many-type-arguments.test \
        semantic/method-virtual.test \
        semantic/method-virtual-body.test \
+       semantic/methodcall-field-initializer-throws.test \
+       semantic/methodcall-void-expression.test \
+       semantic/methodcall-yield-with-begin.test \
        semantic/objectcreation-abstract-class.test \
+       semantic/objectcreation-field-initializer-throws.test \
        semantic/objectcreation-no-creation-method.test \
        semantic/objectcreation-non-public-constructor.test \
        semantic/objectcreation-unsupported-type.test \
diff --git a/tests/semantic/methodcall-field-initializer-throws.test 
b/tests/semantic/methodcall-field-initializer-throws.test
new file mode 100644
index 000000000..8959301ac
--- /dev/null
+++ b/tests/semantic/methodcall-field-initializer-throws.test
@@ -0,0 +1,12 @@
+Invalid Code
+
+class Bar {
+       int bar = foo ();
+}
+
+int foo () throws Error {
+       return 42;
+}
+
+void main () {
+}
diff --git a/tests/semantic/methodcall-void-expression.test b/tests/semantic/methodcall-void-expression.test
new file mode 100644
index 000000000..f03499bee
--- /dev/null
+++ b/tests/semantic/methodcall-void-expression.test
@@ -0,0 +1,8 @@
+Invalid Code
+
+void foo () {
+}
+
+void main () {
+       void* f = foo ();
+}
diff --git a/tests/semantic/methodcall-yield-with-begin.test b/tests/semantic/methodcall-yield-with-begin.test
new file mode 100644
index 000000000..d29ec9176
--- /dev/null
+++ b/tests/semantic/methodcall-yield-with-begin.test
@@ -0,0 +1,11 @@
+Invalid Code
+
+async void foo () {
+}
+
+async void bar () {
+       yield foo.begin ();
+}
+
+void main () {
+}
diff --git a/tests/semantic/objectcreation-field-initializer-throws.test 
b/tests/semantic/objectcreation-field-initializer-throws.test
new file mode 100644
index 000000000..4432003de
--- /dev/null
+++ b/tests/semantic/objectcreation-field-initializer-throws.test
@@ -0,0 +1,13 @@
+Invalid Code
+
+class Bar {
+       Foo bar = new Foo ();
+}
+
+class Foo {
+       public Foo () throws Error {
+       }
+}
+
+void main () {
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]