From: Rico Tzschichholz Date: Wed, 3 Mar 2021 16:59:54 +0000 (+0100) Subject: tests: Extend "pre-post increment" test to increase coverage X-Git-Tag: 0.51.90~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00596a111ccbd7d22e27d68cd05efa6e396aa980;p=thirdparty%2Fvala.git tests: Extend "pre-post increment" test to increase coverage --- 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); + } }