[vala/0.50] tests: Extend "pre-post increment" test to increase coverage
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.50] tests: Extend "pre-post increment" test to increase coverage
- Date: Sun, 14 Mar 2021 15:47:53 +0000 (UTC)
commit da04ee78074a71798faf7fedf1dd0c22cef574e5
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]