[vala/0.38] tests: Add "do-while" parser tests to increase coverage
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.38] tests: Add "do-while" parser tests to increase coverage
- Date: Thu, 11 Jan 2018 08:56:00 +0000 (UTC)
commit a93b88dfec7b1a74187c77a1d33c13ce86203c60
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 36a16cf..7f11b09 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -317,6 +317,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]