summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2019-04-06 10:13:02 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2019-08-06 13:25:17 +0200
commit6792f144872daa5fa663e2526f7ca81b432e492a (patch)
tree05776fcf23244238f4f703fa38931620015173c8
parent8d5e173eca455fda5a3092fcf7905e100b50d824 (diff)
downloadvala-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.vala22
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);
+ }
}