From: Rico Tzschichholz Date: Mon, 5 Feb 2018 09:31:10 +0000 (+0100) Subject: tests: Add invalid "constant" tests to increase coverage X-Git-Tag: 0.39.91~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4825bea27dd071fd2755bf07d816708e91317d6;p=thirdparty%2Fvala.git tests: Add invalid "constant" tests to increase coverage --- diff --git a/tests/Makefile.am b/tests/Makefile.am index 6eb70cea0..bc641846d 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 000000000..76956d176 --- /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 000000000..d92059f30 --- /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 000000000..055926c5e --- /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 000000000..ceb1bae85 --- /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 000000000..0b763232d --- /dev/null +++ b/tests/semantic/constant-void.test @@ -0,0 +1,6 @@ +Invalid Code + +const void FOO = 0; + +void main () { +}