summaryrefslogtreecommitdiff
path: root/testdata
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2013-06-26 03:17:51 (GMT)
committerMarius Kintel <marius@kintel.net>2013-06-26 03:17:51 (GMT)
commitd9b3f7b52b3c3d5c21dc11234325739d3e28ee02 (patch)
treeff734935ba96b0e20721a2f8c330cf68ee9deab0 /testdata
parenta3cd0194943e0468eb196c219a488365a63d72fd (diff)
Test case for #399
Diffstat (limited to 'testdata')
-rw-r--r--testdata/scad/misc/expression-shortcircuit-tests.scad27
1 files changed, 27 insertions, 0 deletions
diff --git a/testdata/scad/misc/expression-shortcircuit-tests.scad b/testdata/scad/misc/expression-shortcircuit-tests.scad
new file mode 100644
index 0000000..dd5a1d5
--- /dev/null
+++ b/testdata/scad/misc/expression-shortcircuit-tests.scad
@@ -0,0 +1,27 @@
+function foo() = search(undef,undef);
+
+if (false && foo()) {
+ echo("Fail");
+} else {
+ echo("Pass");
+}
+
+if (true || foo()) {
+ echo("Pass");
+} else {
+ echo("Fail");
+}
+
+if (true && true) {
+ echo("Pass");
+}
+
+if (false || true) {
+ echo("Pass");
+}
+
+function ternarytest() = true ? true : foo();
+
+if (ternarytest()) {
+ echo("Pass");
+}
contact: Jan Huwald // Impressum