summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Tests/switch-break.js
blob: c8f30aba7e418fd6684b487f4d5de77125b33007 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
test("basic functionality", () => {
    let i = 0;
    let three;
    let five;

    for (; i < 9; ) {
        switch (i) {
            case 3:
                three = i;
                break;
            case 5:
                five = i;
                break;
        }
        ++i;
    }

    expect(three).toBe(3);
    expect(five).toBe(5);
});