openscad/testdata/scad/misc/expression-shortcircuit-tes...

28 lines
335 B
OpenSCAD
Raw Normal View History

2013-06-26 07:17:51 +04:00
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");
}