[vala/0.40] tests: Add "GenericAccessors" tests to increase coverage



commit 63d57350e074ec6c513bc897e0859b8c19fbabc7
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Fri Sep 21 15:48:12 2018 +0200

    tests: Add "GenericAccessors" tests to increase coverage

 tests/Makefile.am             |  2 ++
 tests/generics/bug640330.test | 13 +++++++++++++
 tests/generics/bug640330.vala | 14 ++++++++++++++
 3 files changed, 29 insertions(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index aea6c02d7..857f84f09 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -365,6 +365,8 @@ TESTS = \
        asynchronous/closures.vala \
        asynchronous/generator.vala \
        asynchronous/yield.vala \
+       generics/bug640330.test \
+       generics/bug640330.vala \
        generics/bug694765-1.vala \
        generics/bug694765-2.vala \
        generics/bug694765-3.vala \
diff --git a/tests/generics/bug640330.test b/tests/generics/bug640330.test
new file mode 100644
index 000000000..525cf8e99
--- /dev/null
+++ b/tests/generics/bug640330.test
@@ -0,0 +1,13 @@
+Invalid Code
+
+interface Foo<G> : Object {
+       public virtual G get_foo (G g) {
+               return g;
+       }
+}
+
+class Bar<G> : Object, Foo<G> {
+}
+
+void main () {
+}
diff --git a/tests/generics/bug640330.vala b/tests/generics/bug640330.vala
new file mode 100644
index 000000000..44c5cd9a5
--- /dev/null
+++ b/tests/generics/bug640330.vala
@@ -0,0 +1,14 @@
+[GenericAccessors]
+interface Foo<G> : Object {
+       public virtual G get_foo (G g) {
+               return g;
+       }
+}
+
+class Bar<G> : Object, Foo<G> {
+}
+
+void main () {
+       var bar = new Bar<string> ();
+       assert ("foo" == bar.get_foo ("foo"));
+}


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