From d3aebbe9f7910c67fc0c8f5d4ecd659237273cc5 Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Sun, 14 Apr 2019 15:28:49 +0200 Subject: [PATCH] tests: Extend "assigned local variable" control flow 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); + } } -- 2.47.2