]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add test for nested conditional expression
authorJürg Billeter <j@bitron.ch>
Sat, 17 Sep 2016 18:48:35 +0000 (20:48 +0200)
committerJürg Billeter <j@bitron.ch>
Sat, 17 Sep 2016 18:48:35 +0000 (20:48 +0200)
tests/Makefile.am
tests/control-flow/nested-conditional.vala [new file with mode: 0644]

index ca2a52cf6822f3979bbfffdfd43dc6e6fa711564..0832a41f4d8a0cf5e8f8b54a969dd1149cfd3e90 100644 (file)
@@ -76,6 +76,7 @@ TESTS = \
        control-flow/expressions-conditional.vala \
        control-flow/for.vala \
        control-flow/foreach.vala \
+       control-flow/nested-conditional.vala \
        control-flow/switch.vala \
        control-flow/sideeffects.vala \
        control-flow/bug639482.vala \
diff --git a/tests/control-flow/nested-conditional.vala b/tests/control-flow/nested-conditional.vala
new file mode 100644 (file)
index 0000000..910416b
--- /dev/null
@@ -0,0 +1,8 @@
+bool bar () {
+       assert_not_reached();
+}
+
+void main () {
+       var foo = true ? 0 : (bar() ? 1 : 2);
+       assert(foo == 0);
+}