| 1 |
// test string == and != |
| 2 |
|
| 3 |
null$string => string nullStr; |
| 4 |
"abc" => string abc; |
| 5 |
"abc" => string abc2; |
| 6 |
"def" => string def; |
| 7 |
|
| 8 |
failIfFalse(abc == abc2); |
| 9 |
failIfTrue(abc == def); |
| 10 |
failIfTrue(abc == null); |
| 11 |
failIfFalse(nullStr == null); |
| 12 |
|
| 13 |
failIfTrue(abc != abc2); |
| 14 |
failIfFalse(abc != def); |
| 15 |
failIfFalse(abc != null); |
| 16 |
failIfTrue(nullStr != null); |
| 17 |
|
| 18 |
<<< "success" >>>; |
| 19 |
|
| 20 |
fun void failIfTrue(int b) |
| 21 |
{ |
| 22 |
if(b) |
| 23 |
{ |
| 24 |
<<< "failure" >>>; |
| 25 |
me.exit(); |
| 26 |
} |
| 27 |
} |
| 28 |
|
| 29 |
fun void failIfFalse(int b) |
| 30 |
{ |
| 31 |
if(!b) |
| 32 |
{ |
| 33 |
<<< "failure" >>>; |
| 34 |
me.exit(); |
| 35 |
} |
| 36 |
} |