]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add invalid "constant" tests to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 5 Feb 2018 09:31:10 +0000 (10:31 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 5 Feb 2018 09:31:33 +0000 (10:31 +0100)
tests/Makefile.am
tests/semantic/constant-extern.test [new file with mode: 0644]
tests/semantic/constant-value-missing.test [new file with mode: 0644]
tests/semantic/constant-value-type.test [new file with mode: 0644]
tests/semantic/constant-value.test [new file with mode: 0644]
tests/semantic/constant-void.test [new file with mode: 0644]

index 6eb70cea0ca260c6b14ff56f1d96dcc45adfbf41..bc641846d67b59e0c3ea84f4ef8588ad7908b263 100644 (file)
@@ -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 (file)
index 0000000..76956d1
--- /dev/null
@@ -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 (file)
index 0000000..d92059f
--- /dev/null
@@ -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 (file)
index 0000000..055926c
--- /dev/null
@@ -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 (file)
index 0000000..ceb1bae
--- /dev/null
@@ -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 (file)
index 0000000..0b76323
--- /dev/null
@@ -0,0 +1,6 @@
+Invalid Code
+
+const void FOO = 0;
+
+void main () {
+}