]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add "unassigned local variable in while" test
authorRico Tzschichholz <ricotz@ubuntu.com>
Sat, 6 Apr 2019 12:13:34 +0000 (14:13 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Wed, 10 Apr 2019 14:26:19 +0000 (16:26 +0200)
tests/Makefile.am
tests/control-flow/unassigned-local-variable-while.test [new file with mode: 0644]

index 0dcc0805d564b95e4ae3a83b0aad2710e1981faf..384d6f39546e0f4432bb2ca868fb34ee8c484464 100644 (file)
@@ -160,6 +160,7 @@ TESTS = \
        control-flow/unassigned-captured-local-variable.test \
        control-flow/unassigned-local-block-variable.test \
        control-flow/unassigned-local-variable.test \
+       control-flow/unassigned-local-variable-while.test \
        control-flow/while-false.vala \
        control-flow/bug628336.vala \
        control-flow/bug639482.vala \
diff --git a/tests/control-flow/unassigned-local-variable-while.test b/tests/control-flow/unassigned-local-variable-while.test
new file mode 100644 (file)
index 0000000..d036a56
--- /dev/null
@@ -0,0 +1,11 @@
+Invalid Code
+
+void main () {
+       bool cond = false;
+
+       string s;
+       while (cond) {
+               s = "foo";
+       }
+       print ("%s", s);
+}