Math.cos.js 451 B

123456789101112131415161718
  1. load("test-common.js");
  2. try {
  3. assert(Math.cos(0) === 1);
  4. assert(Math.cos(null) === 1);
  5. assert(Math.cos('') === 1);
  6. assert(Math.cos([]) === 1);
  7. assert(Math.cos(Math.PI) === -1);
  8. assert(isNaN(Math.cos()));
  9. assert(isNaN(Math.cos(undefined)));
  10. assert(isNaN(Math.cos([1, 2, 3])));
  11. assert(isNaN(Math.cos({})));
  12. assert(isNaN(Math.cos("foo")));
  13. console.log("PASS");
  14. } catch (e) {
  15. console.log("FAIL: " + e);
  16. }