diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2019-04-06 10:13:02 +0200 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2019-08-06 13:25:17 +0200 |
commit | 6792f144872daa5fa663e2526f7ca81b432e492a (patch) | |
tree | 05776fcf23244238f4f703fa38931620015173c8 | |
parent | 8d5e173eca455fda5a3092fcf7905e100b50d824 (diff) | |
download | vala-6792f144872daa5fa663e2526f7ca81b432e492a.tar.gz |
tests: Extend "assigned local variable" control flow tests
Cover condition statements of WhileStatement and ConditionalExpression
-rw-r--r-- | tests/control-flow/assigned-local-variable.vala | 22 |
1 files changed, 22 insertions, 0 deletions
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); + } } |