summaryrefslogtreecommitdiff
path: root/testdata/scad/misc/expression-shortcircuit-tests.scad
blob: dd5a1d5de9ceab8c4a671f397cc9efd2be7474ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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