]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Extend "assigned local variable" control flow tests
authorRico Tzschichholz <ricotz@ubuntu.com>
Sun, 14 Apr 2019 13:28:49 +0000 (15:28 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 6 Aug 2019 11:25:23 +0000 (13:25 +0200)
tests/control-flow/assigned-local-variable.vala

index e8121990475423bb1c1fc8822d889074f6c672b6..43ce755e1eb353015c2921aa23c05653d773b81a 100644 (file)
@@ -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);
+       }
 }