[vala/0.44] tests: Extend "assigned local variable" control flow tests



commit 99342ecc03fce24b2cd4c59fee4e656977ad01ef
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sun Apr 14 15:28:49 2019 +0200

    tests: Extend "assigned local variable" control flow tests

 tests/control-flow/assigned-local-variable.vala | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
---
diff --git a/tests/control-flow/assigned-local-variable.vala b/tests/control-flow/assigned-local-variable.vala
index e81219904..43ce755e1 100644
--- a/tests/control-flow/assigned-local-variable.vala
+++ b/tests/control-flow/assigned-local-variable.vala
@@ -20,6 +20,12 @@ void main () {
                        assert_not_reached ();
                }
        }
+       {
+               int i;
+               if ((i = bar ()) > 42 && i < 23) {
+                       assert_not_reached ();
+               }
+       }
 
        {
                string? s;
@@ -33,13 +39,27 @@ void main () {
                        assert_not_reached ();
                }
        }
+       {
+               int i;
+               while ((i = bar ()) > 42 && i < 23) {
+                       assert_not_reached ();
+               }
+       }
 
        {
                string? s;
                assert (!foo (out s) || s == null ? false : true);
        }
+       {
+               string? s;
+               assert (!foo (out s) && s == null ? false : true);
+       }
        {
                int i;
                assert ((i = bar ()) > 42 || i < 23 ? false : true);
        }
+       {
+               int i;
+               assert ((i = bar ()) > 42 && i < 23 ? false : true);
+       }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]