[vala/0.40] tests: Add "unassigned local variable in while" test



commit 5e72f3abfdecfd75321dfb220008cfe38c28e136
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sat Apr 6 14:13:34 2019 +0200

    tests: Add "unassigned local variable in while" test

 tests/Makefile.am                                       |  1 +
 tests/control-flow/unassigned-local-variable-while.test | 11 +++++++++++
 2 files changed, 12 insertions(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index bb624636e..a8fb13f1b 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -154,6 +154,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
index 000000000..d036a56b7
--- /dev/null
+++ b/tests/control-flow/unassigned-local-variable-while.test
@@ -0,0 +1,11 @@
+Invalid Code
+
+void main () {
+       bool cond = false;
+
+       string s;
+       while (cond) {
+               s = "foo";
+       }
+       print ("%s", s);
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]