[vala/staging] tests: Add "do-while" parser tests to increase coverage



commit 993b9ccb5630ccd04bee063c6b4913693ae57915
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sun Jan 7 14:22:20 2018 +0100

    tests: Add "do-while" parser tests to increase coverage

 tests/Makefile.am              |    1 +
 tests/parser/do-statement.vala |   14 ++++++++++++++
 2 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index cf7103a..196a61b 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -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
index 0000000..f2fe992
--- /dev/null
+++ b/tests/parser/do-statement.vala
@@ -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);
+}


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