]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add more "parser" tests to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Thu, 21 Jan 2021 16:40:02 +0000 (17:40 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Thu, 21 Jan 2021 16:40:02 +0000 (17:40 +0100)
tests/Makefile.am
tests/parser/argument-list-incomplete.test [new file with mode: 0644]
tests/parser/attribute-missing-literal.test [new file with mode: 0644]
tests/parser/block-delimiter-missing.test [new file with mode: 0644]
tests/parser/initializer-list-incomplete.test [new file with mode: 0644]

index 6211ba77c1e5559d88cfc54acc7918fc3750e931..6ee9ee25a4dbd1548b012a25ae2b396b9ff78be2 100644 (file)
@@ -743,10 +743,13 @@ TESTS = \
        scanner/string-escape-x-digit-length.test \
        scanner/string-escape-x-empty.test \
        scanner/string-escape-x.vala \
+       parser/argument-list-incomplete.test \
        parser/array-creation-invalid.test \
        parser/assignment.vala \
        parser/attribute-duplicate.test \
+       parser/attribute-missing-literal.test \
        parser/attribute-wrong-number.test \
+       parser/block-delimiter-missing.test \
        parser/constant-owned.test \
        parser/constant-local-owned.test \
        parser/constructor-class-exists.test \
@@ -778,6 +781,7 @@ TESTS = \
        parser/foreach.vala \
        parser/foreach-no-type.test \
        parser/function-syntax-error.test \
+       parser/initializer-list-incomplete.test \
        parser/inner-array-size.test \
        parser/invalid-brace.test \
        parser/invalid-statement-delimiter.test \
diff --git a/tests/parser/argument-list-incomplete.test b/tests/parser/argument-list-incomplete.test
new file mode 100644 (file)
index 0000000..0d1f867
--- /dev/null
@@ -0,0 +1,8 @@
+Invalid Code
+
+void foo (int i, string s) {
+}
+
+void main () {
+       foo (42, );
+}
diff --git a/tests/parser/attribute-missing-literal.test b/tests/parser/attribute-missing-literal.test
new file mode 100644 (file)
index 0000000..e0d7acf
--- /dev/null
@@ -0,0 +1,5 @@
+Invalid Code
+
+[Attribute (prop = )]
+void main () {
+}
diff --git a/tests/parser/block-delimiter-missing.test b/tests/parser/block-delimiter-missing.test
new file mode 100644 (file)
index 0000000..c17135d
--- /dev/null
@@ -0,0 +1,5 @@
+Invalid Code
+
+void main () {
+       string[] foo = { "foo";
+}
diff --git a/tests/parser/initializer-list-incomplete.test b/tests/parser/initializer-list-incomplete.test
new file mode 100644 (file)
index 0000000..9b67d64
--- /dev/null
@@ -0,0 +1,10 @@
+Invalid Code
+
+struct Foo {
+       unowned string s;
+       int i;
+}
+
+void main () {
+       Foo foo = { i = 42, s = };
+}