From: Rico Tzschichholz Date: Sun, 14 Apr 2019 13:28:49 +0000 (+0200) Subject: tests: Extend "assigned local variable" control flow tests X-Git-Tag: 0.36.20~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3aebbe9f7910c67fc0c8f5d4ecd659237273cc5;p=thirdparty%2Fvala.git tests: Extend "assigned local variable" control flow tests --- 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); + } }