]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add "continue" parser test to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Sun, 7 Jan 2018 15:07:22 +0000 (16:07 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Wed, 10 Jan 2018 19:46:00 +0000 (20:46 +0100)
tests/Makefile.am
tests/parser/continue-statement.vala [new file with mode: 0644]

index 4df7b6685a7a668f05b4740f12531639f9be19d7..cbd116e344146a0c26625f58176711b51fec1d0c 100644 (file)
@@ -318,6 +318,7 @@ TESTS = \
        annotations/description.vala \
        annotations/noaccessormethod.test \
        parser/assignment.vala \
+       parser/continue-statement.vala \
        parser/do-statement.vala \
        parser/preprocessor.vala \
        parser/template.vala \
diff --git a/tests/parser/continue-statement.vala b/tests/parser/continue-statement.vala
new file mode 100644 (file)
index 0000000..c79e810
--- /dev/null
@@ -0,0 +1,12 @@
+void main () {
+       int i = 0;
+
+       while (true) {
+               if (i == 0) {
+                       i = 42;
+                       continue;
+               }
+               break;
+       }
+       assert (i == 42);
+}