]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add "do-while" parser tests to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Sun, 7 Jan 2018 13:22:20 +0000 (14:22 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sun, 7 Jan 2018 19:26:03 +0000 (20:26 +0100)
tests/Makefile.am
tests/parser/do-statement.vala [new file with mode: 0644]

index cf7103a00330199f75bb80727c3add381c631245..196a61ba3188c5ca67b6c1724e8cfdb2afbb5c81 100644 (file)
@@ -321,6 +321,7 @@ TESTS = \
        annotations/deprecated.vala \
        annotations/description.vala \
        annotations/noaccessormethod.test \
+       parser/do-statement.vala \
        parser/switch-statement.vala \
        parser/template.vala \
        parser/tuple.vala \
diff --git a/tests/parser/do-statement.vala b/tests/parser/do-statement.vala
new file mode 100644 (file)
index 0000000..f2fe992
--- /dev/null
@@ -0,0 +1,14 @@
+void main () {
+       int i = 0;
+
+       do {
+               i++;
+       } while (i < 2);
+       assert (i == 2);
+
+       do {
+               i = 42;
+               break;
+       } while (true);
+       assert (i == 42);
+}