MOON
Server: Apache
System: Linux e2e-78-16.ssdcloudindia.net 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
User: imensosw (1005)
PHP: 8.0.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/imensosw/.trash/node_modules/object-inspect/test/bigint.js
var inspect = require('../');
var test = require('tape');

test('bigint', { skip: typeof BigInt === 'undefined' }, function (t) {
  t.test('primitives', function (st) {
    st.plan(3);

    st.equal(inspect(BigInt(-256)), '-256n');
    st.equal(inspect(BigInt(0)), '0n');
    st.equal(inspect(BigInt(256)), '256n');
  });

  t.test('objects', function (st) {
    st.plan(3);

    st.equal(inspect(Object(BigInt(-256))), 'Object(-256n)');
    st.equal(inspect(Object(BigInt(0))), 'Object(0n)');
    st.equal(inspect(Object(BigInt(256))), 'Object(256n)');
  });

  t.test('syntactic primitives', function (st) {
    st.plan(3);

    st.equal(inspect(Function('return -256n')()), '-256n');
    st.equal(inspect(Function('return 0n')()), '0n');
    st.equal(inspect(Function('return 256n')()), '256n');
  });

  t.end();
});