[vala/staging] tests: Extend "pre-post increment" test to increase coverage



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]