[vala/staging] tests: Add "continue" parser test to increase coverage



commit eb8761bb5f0f0d3058fb5c4d4f16140539b4891c
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sun Jan 7 16:07:22 2018 +0100

    tests: Add "continue" parser test to increase coverage

 tests/Makefile.am                    |    1 +
 tests/parser/continue-statement.vala |   12 ++++++++++++
 2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a93a6f5..349dd02 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -322,6 +322,7 @@ TESTS = \
        annotations/description.vala \
        annotations/noaccessormethod.test \
        parser/assignment.vala \
+       parser/continue-statement.vala \
        parser/do-statement.vala \
        parser/preprocessor.vala \
        parser/switch-statement.vala \
diff --git a/tests/parser/continue-statement.vala b/tests/parser/continue-statement.vala
new file mode 100644
index 0000000..c79e810
--- /dev/null
+++ b/tests/parser/continue-statement.vala
@@ -0,0 +1,12 @@
+void main () {
+       int i = 0;
+
+       while (true) {
+               if (i == 0) {
+                       i = 42;
+                       continue;
+               }
+               break;
+       }
+       assert (i == 42);
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]