[vala/0.42] tests: Add some invalid "signal" tests to increase coverage



commit a18a5521c82daadd7a00759363bccd11259d5266
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sat Sep 22 18:30:17 2018 +0200

    tests: Add some invalid "signal" tests to increase coverage

 tests/Makefile.am                            |  4 ++++
 tests/semantic/signal-clash-inherited.test   | 12 ++++++++++++
 tests/semantic/signal-compact-class.test     |  9 +++++++++
 tests/semantic/signal-detail-invalid.test    | 11 +++++++++++
 tests/semantic/signal-detail-non-string.test | 11 +++++++++++
 5 files changed, 47 insertions(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index da1b33169..268d2b8d4 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -599,6 +599,10 @@ TESTS = \
        semantic/property-struct-protected.test \
        semantic/property-struct-virtual.test \
        semantic/property-void.test \
+       semantic/signal-clash-inherited.test \
+       semantic/signal-compact-class.test \
+       semantic/signal-detail-invalid.test \
+       semantic/signal-detail-non-string.test \
        semantic/struct-derived.test \
        semantic/struct-field-initializer.test \
        semantic/struct-invalid-base.test \
diff --git a/tests/semantic/signal-clash-inherited.test b/tests/semantic/signal-clash-inherited.test
new file mode 100644
index 000000000..6cceb9afc
--- /dev/null
+++ b/tests/semantic/signal-clash-inherited.test
@@ -0,0 +1,12 @@
+Invalid Code
+
+class Foo {
+       public signal void foo ();
+}
+
+class Bar : Foo {
+       public new signal void foo ();
+}
+
+void main () {
+}
diff --git a/tests/semantic/signal-compact-class.test b/tests/semantic/signal-compact-class.test
new file mode 100644
index 000000000..da608e145
--- /dev/null
+++ b/tests/semantic/signal-compact-class.test
@@ -0,0 +1,9 @@
+Invalid Code
+
+[Compact]
+class Foo {
+       public signal void foo ();
+}
+
+void main () {
+}
diff --git a/tests/semantic/signal-detail-invalid.test b/tests/semantic/signal-detail-invalid.test
new file mode 100644
index 000000000..c5a2ad456
--- /dev/null
+++ b/tests/semantic/signal-detail-invalid.test
@@ -0,0 +1,11 @@
+Invalid Code
+
+class Foo {
+       [Signal (detailed = true)]
+       public signal void foo ();
+}
+
+void main () {
+       var foo = new Foo ();
+       foo.foo["detail", "fail"].connect (() => {});
+}
diff --git a/tests/semantic/signal-detail-non-string.test b/tests/semantic/signal-detail-non-string.test
new file mode 100644
index 000000000..ca6fe606e
--- /dev/null
+++ b/tests/semantic/signal-detail-non-string.test
@@ -0,0 +1,11 @@
+Invalid Code
+
+class Foo {
+       [Signal (detailed = true)]
+       public signal void foo ();
+}
+
+void main () {
+       var foo = new Foo ();
+       foo.foo[42].connect (() => {});
+}


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