Serenity Operating System
1test("basic functionality", () => {
2 const x = 1;
3
4 expect(x === 1 ? true : false).toBeTrue();
5 expect(x ? x : 0).toBe(x);
6 expect(1 < 2 ? true : false).toBeTrue();
7 expect(0 ? 1 : 1 ? 10 : 20).toBe(10);
8 expect(0 ? (1 ? 1 : 10) : 20).toBe(20);
9});
10
11test("object values", () => {
12 const o = {};
13 o.f = true;
14 expect(o.f ? true : false).toBeTrue();
15 expect(1 ? o.f : null).toBeTrue();
16});
17
18test("issue #4409, '?.' followed by decimal digit", () => {
19 expect("false?.1:.2").toEvalTo(0.2);
20});