2020-04-13 10:31:13 -07:00
|
|
|
load("test-common.js");
|
|
|
|
|
|
2020-04-03 12:14:28 +02:00
|
|
|
try {
|
2020-07-05 09:27:00 -07:00
|
|
|
var x = 1;
|
2020-04-03 12:14:28 +02:00
|
|
|
|
2020-07-05 09:27:00 -07:00
|
|
|
assert(x === 1 ? true : false);
|
|
|
|
|
assert((x ? x : 0) === x);
|
|
|
|
|
assert(1 < 2 ? true : false);
|
|
|
|
|
assert((0 ? 1 : 1 ? 10 : 20) === 10);
|
|
|
|
|
assert((0 ? (1 ? 1 : 10) : 20) === 20);
|
2020-04-03 12:14:28 +02:00
|
|
|
|
2020-07-05 09:27:00 -07:00
|
|
|
var o = {};
|
|
|
|
|
o.f = true;
|
|
|
|
|
assert(o.f ? true : false);
|
2020-04-03 12:14:28 +02:00
|
|
|
|
2020-07-05 09:27:00 -07:00
|
|
|
assert(1 ? o.f : null);
|
2020-04-03 12:14:28 +02:00
|
|
|
|
2020-07-05 09:27:00 -07:00
|
|
|
console.log("PASS");
|
2020-04-03 12:14:28 +02:00
|
|
|
} catch (e) {
|
2020-07-05 09:27:00 -07:00
|
|
|
console.log("FAIL: " + e);
|
2020-04-03 12:14:28 +02:00
|
|
|
}
|