From: Rico Tzschichholz Date: Sat, 6 Apr 2019 08:13:02 +0000 (+0200) Subject: tests: Extend "assigned local variable" control flow tests X-Git-Tag: 0.42.7~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d4f9c740b7d9aea2cd5c2959e2b4547408e72d2;p=thirdparty%2Fvala.git tests: Extend "assigned local variable" control flow tests Cover condition statements of WhileStatement and ConditionalExpression --- 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); + } }