[vala/0.40] tests: Add invalid "method to delegate" test to increase coverage



commit eb72bb2e2d7cf664fc06c0daa8a9c72fb3f64f45
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Fri Sep 21 17:34:00 2018 +0200

    tests: Add invalid "method to delegate" test to increase coverage

 tests/Makefile.am                                 |  1 +
 tests/delegates/instance-method-to-no-target.test | 14 ++++++++++++++
 2 files changed, 15 insertions(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 4196c6afd..a55e3a621 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -212,6 +212,7 @@ TESTS = \
        delegates/delegates-error.test \
        delegates/fields.vala \
        delegates/fields-no-target.vala \
+       delegates/instance-method-to-no-target.test \
        delegates/reference_transfer.vala \
        delegates/wrapper.vala \
        delegates/bug519949.test \
diff --git a/tests/delegates/instance-method-to-no-target.test 
b/tests/delegates/instance-method-to-no-target.test
new file mode 100644
index 000000000..6f7a0a546
--- /dev/null
+++ b/tests/delegates/instance-method-to-no-target.test
@@ -0,0 +1,14 @@
+Invalid Code
+
+[CCode (has_target = false)]
+delegate void Foo ();
+
+class Bar {
+       public void foo () {
+       }
+}
+
+void main () {
+       var bar = new Bar ();
+       Foo foo = bar.foo;
+}


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