summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Tests/parser-unary-associativity.js
blob: 25763eda6ce286daa6a21535131403124e60c59c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
test("basic functionality", () => {
    const o = {};
    o.a = 1;

    expect(o.a === 1).toBeTrue();
    expect(!o.a === false).toBeTrue();
    expect(!o.a === !o.a).toBeTrue();
    expect(~o.a === ~o.a).toBeTrue();
    expect(+o.a === +o.a).toBeTrue();
    expect(-o.a === -o.a).toBeTrue();

    expect((typeof "x" === "string") === true).toBeTrue();
    expect(!(typeof "x" === "string") === false).toBeTrue();
});