diff options
| author | Marius Kintel <marius@kintel.net> | 2013-06-26 03:17:51 (GMT) | 
|---|---|---|
| committer | Marius Kintel <marius@kintel.net> | 2013-06-26 03:17:51 (GMT) | 
| commit | d9b3f7b52b3c3d5c21dc11234325739d3e28ee02 (patch) | |
| tree | ff734935ba96b0e20721a2f8c330cf68ee9deab0 /testdata | |
| parent | a3cd0194943e0468eb196c219a488365a63d72fd (diff) | |
Test case for #399
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"); +} | 
