[vala/staging] tests: Extend "pre-post increment" test to increase coverage
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging] tests: Extend "pre-post increment" test to increase coverage
- Date: Wed, 3 Mar 2021 17:03:57 +0000 (UTC)
commit 00596a111ccbd7d22e27d68cd05efa6e396aa980
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Wed Mar 3 17:59:54 2021 +0100
tests: Extend "pre-post increment" test to increase coverage
tests/control-flow/pre-post-increment.vala | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
---
diff --git a/tests/control-flow/pre-post-increment.vala b/tests/control-flow/pre-post-increment.vala
index e0bf28bcb..cb4d31423 100644
--- a/tests/control-flow/pre-post-increment.vala
+++ b/tests/control-flow/pre-post-increment.vala
@@ -17,5 +17,25 @@ void main () {
int i = 0;
assert (++i == 1);
}
+ {
+ int i = 1;
+ i -= i++ % 2;
+ assert (i == 1);
+ }
+ {
+ int i = 1;
+ i -= ++i % 2;
+ assert (i == 2);
+ }
+ {
+ int i = 1;
+ i += i++ % 2;
+ assert (i == 3);
+ }
+ {
+ int i = 1;
+ i += ++i % 2;
+ assert (i == 2);
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]