[vala/staging] tests: Add "unassigned local variable in while" test
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging] tests: Add "unassigned local variable in while" test
- Date: Sat, 6 Apr 2019 20:37:30 +0000 (UTC)
commit b9b8d511aa0904550ca1292c074fcf76fda0fc0d
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 ce19144f7..e61c65b18 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -164,6 +164,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]