summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Tests/Math.cos.js
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibJS/Tests/Math.cos.js')
-rw-r--r--Libraries/LibJS/Tests/Math.cos.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/Libraries/LibJS/Tests/Math.cos.js b/Libraries/LibJS/Tests/Math.cos.js
new file mode 100644
index 0000000000..2af3d7dbb8
--- /dev/null
+++ b/Libraries/LibJS/Tests/Math.cos.js
@@ -0,0 +1,16 @@
+try {
+ assert(Math.cos(0) === 1);
+ assert(Math.cos(null) === 1);
+ assert(Math.cos('') === 1);
+ assert(Math.cos([]) === 1);
+ assert(Math.cos(Math.PI) === -1);
+ assert(isNaN(Math.cos()));
+ assert(isNaN(Math.cos(undefined)));
+ assert(isNaN(Math.cos([1, 2, 3])));
+ assert(isNaN(Math.cos({})));
+ assert(isNaN(Math.cos("foo")));
+
+ console.log("PASS");
+} catch (e) {
+ console.log("FAIL: " + e);
+}