diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2021-03-03 17:59:54 +0100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2021-03-13 21:22:57 +0100 |
commit | da04ee78074a71798faf7fedf1dd0c22cef574e5 (patch) | |
tree | 3deee3dd27fd11af32327df0734f018014a2db84 | |
parent | 7c4d921f50b5ddef3584db4a2debd4b905f55c10 (diff) | |
download | vala-da04ee78074a71798faf7fedf1dd0c22cef574e5.tar.gz |
tests: Extend "pre-post increment" test to increase coverage
-rw-r--r-- | tests/control-flow/pre-post-increment.vala | 20 |
1 files changed, 20 insertions, 0 deletions
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); + } } |