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



commit 090496cc9778db2b7524320ce0ad7e61dc4c3ae2
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sat Apr 6 10:13:02 2019 +0200

    tests: Extend "assigned local variable" control flow tests
    
    Cover condition statements of WhileStatement and ConditionalExpression

 tests/control-flow/assigned-local-variable.vala | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
---
diff --git a/tests/control-flow/assigned-local-variable.vala b/tests/control-flow/assigned-local-variable.vala
index 7946d72ea..e81219904 100644
--- a/tests/control-flow/assigned-local-variable.vala
+++ b/tests/control-flow/assigned-local-variable.vala
@@ -20,4 +20,26 @@ void main () {
                        assert_not_reached ();
                }
        }
+
+       {
+               string? s;
+               while (!foo (out s) || s == null) {
+                       assert_not_reached ();
+               }
+       }
+       {
+               int i;
+               while ((i = bar ()) > 42 || i < 23) {
+                       assert_not_reached ();
+               }
+       }
+
+       {
+               string? s;
+               assert (!foo (out s) || s == null ? 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]