From e2fd41e1e98cc01b2551803e2c40420594391411 Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Thu, 14 Jun 2018 08:09:48 +0200 Subject: [PATCH] tests: Add invalid array initializer tests to increase coverage --- tests/Makefile.am | 2 ++ tests/semantic/array-incompatible-initializer.test | 5 +++++ tests/semantic/array-incompatible-initializer2.test | 5 +++++ 3 files changed, 12 insertions(+) create mode 100644 tests/semantic/array-incompatible-initializer.test create mode 100644 tests/semantic/array-incompatible-initializer2.test diff --git a/tests/Makefile.am b/tests/Makefile.am index dc98b21b0..612f9cc31 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -467,6 +467,8 @@ TESTS = \ parser/yield-method.test \ parser/bug728574.vala \ parser/bug749576.vala \ + semantic/array-incompatible-initializer.test \ + semantic/array-incompatible-initializer2.test \ semantic/assignment-element-incompatible-ownership.test \ semantic/assignment-element-incompatible-type.test \ semantic/assignment-same-variable.vala \ diff --git a/tests/semantic/array-incompatible-initializer.test b/tests/semantic/array-incompatible-initializer.test new file mode 100644 index 000000000..6b3c229a7 --- /dev/null +++ b/tests/semantic/array-incompatible-initializer.test @@ -0,0 +1,5 @@ +Invalid Code + +void main () { + string[,] a = { "foo" }; +} diff --git a/tests/semantic/array-incompatible-initializer2.test b/tests/semantic/array-incompatible-initializer2.test new file mode 100644 index 000000000..82daef8a3 --- /dev/null +++ b/tests/semantic/array-incompatible-initializer2.test @@ -0,0 +1,5 @@ +Invalid Code + +void main () { + string[] a = { { "foo" } }; +} -- 2.47.2