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



commit 9b50d679cefe3ee2ac9b7550f34749b3fc0ac3f6
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 fc161d099..89020c012 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -600,6 +600,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]