[vala/0.36: 137/173] tests: Add "do-while" parser tests to increase coverage



commit c3aea27a981e50a6953ea407e79271ad375d6c8a
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 7966968..67edd68 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -315,6 +315,7 @@ TESTS = \
        annotations/deprecated.vala \
        annotations/description.vala \
        annotations/noaccessormethod.test \
+       parser/do-statement.vala \
        parser/template.vala \
        parser/tuple.vala \
        $(NULL)
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]