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



commit 6aa0ef531ad3aca83fb1078f9f2a272a7222981c
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 12fa404cc..2a780a019 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -219,6 +219,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]