summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Tests/Math.sin.js
blob: 50a591b1c9ae7941a66be9ebf1e748b38e40b172 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
load("test-common.js");

try {
    assert(Math.sin(0) === 0);
    assert(Math.sin(null) === 0);
    assert(Math.sin('') === 0);
    assert(Math.sin([]) === 0);
    assert(Math.sin(Math.PI * 3 / 2) === -1);
    assert(Math.sin(Math.PI / 2) === 1);
    assert(isNaN(Math.sin()));
    assert(isNaN(Math.sin(undefined)));
    assert(isNaN(Math.sin([1, 2, 3])));
    assert(isNaN(Math.sin({})));
    assert(isNaN(Math.sin("foo")));

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