[vala/wip/tests] tests: Add invalid "constant" tests to increase coverage



commit e4825bea27dd071fd2755bf07d816708e91317d6
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Mon Feb 5 10:31:10 2018 +0100

    tests: Add invalid "constant" tests to increase coverage

 tests/Makefile.am                          |    5 +++++
 tests/semantic/constant-extern.test        |    6 ++++++
 tests/semantic/constant-value-missing.test |    6 ++++++
 tests/semantic/constant-value-type.test    |    6 ++++++
 tests/semantic/constant-value.test         |   10 ++++++++++
 tests/semantic/constant-void.test          |    6 ++++++
 6 files changed, 39 insertions(+), 0 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 6eb70ce..bc64184 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -390,6 +390,11 @@ TESTS = \
        parser/unsupported-property-async.test \
        parser/unsupported-property-throws.test \
        parser/yield-method.test \
+       semantic/constant-extern.test \
+       semantic/constant-value.test \
+       semantic/constant-value-missing.test \
+       semantic/constant-value-type.test \
+       semantic/constant-void.test \
        semantic/field-accessibility.test \
        semantic/field-compact-static.test \
        semantic/field-external.test \
diff --git a/tests/semantic/constant-extern.test b/tests/semantic/constant-extern.test
new file mode 100644
index 0000000..76956d1
--- /dev/null
+++ b/tests/semantic/constant-extern.test
@@ -0,0 +1,6 @@
+Invalid Code
+
+extern const string FOO = "foo";
+
+void main () {
+}
diff --git a/tests/semantic/constant-value-missing.test b/tests/semantic/constant-value-missing.test
new file mode 100644
index 0000000..d92059f
--- /dev/null
+++ b/tests/semantic/constant-value-missing.test
@@ -0,0 +1,6 @@
+Invalid Code
+
+const string FOO;
+
+void main () {
+}
diff --git a/tests/semantic/constant-value-type.test b/tests/semantic/constant-value-type.test
new file mode 100644
index 0000000..055926c
--- /dev/null
+++ b/tests/semantic/constant-value-type.test
@@ -0,0 +1,6 @@
+Invalid Code
+
+const string FOO = 23;
+
+void main () {
+}
diff --git a/tests/semantic/constant-value.test b/tests/semantic/constant-value.test
new file mode 100644
index 0000000..ceb1bae
--- /dev/null
+++ b/tests/semantic/constant-value.test
@@ -0,0 +1,10 @@
+Invalid Code
+
+const string FOO = get_foo ();
+
+string get_foo () {
+       return "foo";
+}
+
+void main () {
+}
diff --git a/tests/semantic/constant-void.test b/tests/semantic/constant-void.test
new file mode 100644
index 0000000..0b76323
--- /dev/null
+++ b/tests/semantic/constant-void.test
@@ -0,0 +1,6 @@
+Invalid Code
+
+const void FOO = 0;
+
+void main () {
+}


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