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



commit 194cec929493de5be831eca3c1e5d4d2277b6b90
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]