diff options
Diffstat (limited to 'testdata')
-rw-r--r-- | testdata/scad/misc/expression-shortcircuit-tests.scad | 27 |
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"); +} |