summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Tests/while-basic.js
blob: 5868ec7170e1d3de5e9027abe451c213806496c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
load("test-common.js");

try {
    var number = 0;
    while (number < 9) {
        number++;
    }
    assert(number === 9);

    number = 0;
    while(number < 3) number++;
    assert(number === 3);

    while (false) {
        assertNotReached();
    }

    console.log("PASS");
} catch (e) {
    console.log("FAIL: " + e);
}