Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

bigint.js 821B

123456789101112131415161718192021222324252627282930
  1. var inspect = require('../');
  2. var test = require('tape');
  3. test('bigint', { skip: typeof BigInt === 'undefined' }, function (t) {
  4. t.test('primitives', function (st) {
  5. st.plan(3);
  6. st.equal(inspect(BigInt(-256)), '-256n');
  7. st.equal(inspect(BigInt(0)), '0n');
  8. st.equal(inspect(BigInt(256)), '256n');
  9. });
  10. t.test('objects', function (st) {
  11. st.plan(3);
  12. st.equal(inspect(Object(BigInt(-256))), 'Object(-256n)');
  13. st.equal(inspect(Object(BigInt(0))), 'Object(0n)');
  14. st.equal(inspect(Object(BigInt(256))), 'Object(256n)');
  15. });
  16. t.test('syntactic primitives', function (st) {
  17. st.plan(3);
  18. st.equal(inspect(Function('return -256n')()), '-256n');
  19. st.equal(inspect(Function('return 0n')()), '0n');
  20. st.equal(inspect(Function('return 256n')()), '256n');
  21. });
  22. t.end();
  23. });