var ui32 = new Uint32Array(4).fill(42);
var e = Buffer.from(ui32);
-assert.deepEqual(ui32, e);
+for (var [index, value] of e.entries()) {
+ assert.strictEqual(value, ui32[index]);
+}
// First check Buffer#fill() works as expected.
assert.equal(d[0], 23);
assert.equal(d[1], 42);
assert.equal(d[2], 255);
- assert.deepEqual(d, Buffer.from(d));
+ assert.deepStrictEqual(d, Buffer.from(d));
}
{
var e = Buffer.from('über');
// console.error('uber: \'%s\'', e.toString());
- assert.deepEqual(e, Buffer.from([195, 188, 98, 101, 114]));
+ assert.deepStrictEqual(e, Buffer.from([195, 188, 98, 101, 114]));
}
{
var f = Buffer.from('über', 'ascii');
// console.error('f.length: %d (should be 4)', f.length);
- assert.deepEqual(f, Buffer.from([252, 98, 101, 114]));
+ assert.deepStrictEqual(f, Buffer.from([252, 98, 101, 114]));
}
['ucs2', 'ucs-2', 'utf16le', 'utf-16le'].forEach(function(encoding) {
{
var f = Buffer.from('über', encoding);
// console.error('f.length: %d (should be 8)', f.length);
- assert.deepEqual(f, Buffer.from([252, 0, 98, 0, 101, 0, 114, 0]));
+ assert.deepStrictEqual(f, Buffer.from([252, 0, 98, 0, 101, 0, 114, 0]));
}
{
var f = Buffer.from('привет', encoding);
// console.error('f.length: %d (should be 12)', f.length);
- assert.deepEqual(f,
+ assert.deepStrictEqual(f,
Buffer.from([63, 4, 64, 4, 56, 4, 50, 4, 53, 4, 66, 4]));
assert.equal(f.toString(encoding), 'привет');
}
var size = f.write('あいうえお', encoding);
// console.error('bytes written to buffer: %d (should be 4)', size);
assert.equal(size, 4);
- assert.deepEqual(f, Buffer.from([0x42, 0x30, 0x44, 0x30, 0x00]));
+ assert.deepStrictEqual(f, Buffer.from([0x42, 0x30, 0x44, 0x30, 0x00]));
}
});
{
var f = Buffer.from('\uD83D\uDC4D', 'utf-16le'); // THUMBS UP SIGN (U+1F44D)
assert.equal(f.length, 4);
- assert.deepEqual(f, Buffer.from('3DD84DDC', 'hex'));
+ assert.deepStrictEqual(f, Buffer.from('3DD84DDC', 'hex'));
}
var arrayIsh = {0: 0, 1: 1, 2: 2, 3: 3, length: 4};
var g = Buffer.from(arrayIsh);
-assert.deepEqual(g, Buffer.from([0, 1, 2, 3]));
+assert.deepStrictEqual(g, Buffer.from([0, 1, 2, 3]));
var strArrayIsh = {0: '0', 1: '1', 2: '2', 3: '3', length: 4};
g = Buffer.from(strArrayIsh);
-assert.deepEqual(g, Buffer.from([0, 1, 2, 3]));
+assert.deepStrictEqual(g, Buffer.from([0, 1, 2, 3]));
//
{
// test that regular and URL-safe base64 both work
var expected = [0xff, 0xff, 0xbe, 0xff, 0xef, 0xbf, 0xfb, 0xef, 0xff];
- assert.deepEqual(Buffer.from('//++/++/++//', 'base64'),
- Buffer.from(expected));
- assert.deepEqual(Buffer.from('__--_--_--__', 'base64'),
- Buffer.from(expected));
+ assert.deepStrictEqual(Buffer.from('//++/++/++//', 'base64'),
+ Buffer.from(expected));
+ assert.deepStrictEqual(Buffer.from('__--_--_--__', 'base64'),
+ Buffer.from(expected));
}
{
'********************');
// handle padding graciously, multiple-of-4 or not
-assert.equal(Buffer.from('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw==',
- 'base64').length, 32);
-assert.equal(Buffer.from('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw=',
- 'base64').length, 32);
-assert.equal(Buffer.from('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw',
- 'base64').length, 32);
-assert.equal(Buffer.from('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg==',
- 'base64').length, 31);
-assert.equal(Buffer.from('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg=',
- 'base64').length, 31);
-assert.equal(Buffer.from('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg',
- 'base64').length, 31);
+assert.equal(
+ Buffer.from('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw==', 'base64').length,
+ 32
+);
+assert.equal(
+ Buffer.from('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw=', 'base64').length,
+ 32
+);
+assert.equal(
+ Buffer.from('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw', 'base64').length,
+ 32
+);
+assert.equal(
+ Buffer.from('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg==', 'base64').length,
+ 31
+);
+assert.equal(
+ Buffer.from('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg=', 'base64').length,
+ 31
+);
+assert.equal(
+ Buffer.from('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg', 'base64').length,
+ 31
+);
// This string encodes single '.' character in UTF-16
var dot = Buffer.from('//4uAA==', 'base64');
assert.equal(string, '{"type":"Buffer","data":[116,101,115,116]}');
- assert.deepEqual(buffer, JSON.parse(string, function(key, value) {
+ assert.deepStrictEqual(buffer, JSON.parse(string, function(key, value) {
return value && value.type === 'Buffer'
? Buffer.from(value.data)
: value;
(function() {
var buf = Buffer.allocUnsafe(3);
buf.writeUIntLE(0x123456, 0, 3);
- assert.deepEqual(buf.toJSON().data, [0x56, 0x34, 0x12]);
+ assert.deepStrictEqual(buf.toJSON().data, [0x56, 0x34, 0x12]);
assert.equal(buf.readUIntLE(0, 3), 0x123456);
buf = Buffer.allocUnsafe(3);
buf.writeUIntBE(0x123456, 0, 3);
- assert.deepEqual(buf.toJSON().data, [0x12, 0x34, 0x56]);
+ assert.deepStrictEqual(buf.toJSON().data, [0x12, 0x34, 0x56]);
assert.equal(buf.readUIntBE(0, 3), 0x123456);
buf = Buffer.allocUnsafe(3);
buf.writeIntLE(0x123456, 0, 3);
- assert.deepEqual(buf.toJSON().data, [0x56, 0x34, 0x12]);
+ assert.deepStrictEqual(buf.toJSON().data, [0x56, 0x34, 0x12]);
assert.equal(buf.readIntLE(0, 3), 0x123456);
buf = Buffer.allocUnsafe(3);
buf.writeIntBE(0x123456, 0, 3);
- assert.deepEqual(buf.toJSON().data, [0x12, 0x34, 0x56]);
+ assert.deepStrictEqual(buf.toJSON().data, [0x12, 0x34, 0x56]);
assert.equal(buf.readIntBE(0, 3), 0x123456);
buf = Buffer.allocUnsafe(3);
buf.writeIntLE(-0x123456, 0, 3);
- assert.deepEqual(buf.toJSON().data, [0xaa, 0xcb, 0xed]);
+ assert.deepStrictEqual(buf.toJSON().data, [0xaa, 0xcb, 0xed]);
assert.equal(buf.readIntLE(0, 3), -0x123456);
buf = Buffer.allocUnsafe(3);
buf.writeIntBE(-0x123456, 0, 3);
- assert.deepEqual(buf.toJSON().data, [0xed, 0xcb, 0xaa]);
+ assert.deepStrictEqual(buf.toJSON().data, [0xed, 0xcb, 0xaa]);
assert.equal(buf.readIntBE(0, 3), -0x123456);
buf = Buffer.allocUnsafe(3);
buf.writeIntLE(-0x123400, 0, 3);
- assert.deepEqual(buf.toJSON().data, [0x00, 0xcc, 0xed]);
+ assert.deepStrictEqual(buf.toJSON().data, [0x00, 0xcc, 0xed]);
assert.equal(buf.readIntLE(0, 3), -0x123400);
buf = Buffer.allocUnsafe(3);
buf.writeIntBE(-0x123400, 0, 3);
- assert.deepEqual(buf.toJSON().data, [0xed, 0xcc, 0x00]);
+ assert.deepStrictEqual(buf.toJSON().data, [0xed, 0xcc, 0x00]);
assert.equal(buf.readIntBE(0, 3), -0x123400);
buf = Buffer.allocUnsafe(3);
buf.writeIntLE(-0x120000, 0, 3);
- assert.deepEqual(buf.toJSON().data, [0x00, 0x00, 0xee]);
+ assert.deepStrictEqual(buf.toJSON().data, [0x00, 0x00, 0xee]);
assert.equal(buf.readIntLE(0, 3), -0x120000);
buf = Buffer.allocUnsafe(3);
buf.writeIntBE(-0x120000, 0, 3);
- assert.deepEqual(buf.toJSON().data, [0xee, 0x00, 0x00]);
+ assert.deepStrictEqual(buf.toJSON().data, [0xee, 0x00, 0x00]);
assert.equal(buf.readIntBE(0, 3), -0x120000);
buf = Buffer.allocUnsafe(5);
buf.writeUIntLE(0x1234567890, 0, 5);
- assert.deepEqual(buf.toJSON().data, [0x90, 0x78, 0x56, 0x34, 0x12]);
+ assert.deepStrictEqual(buf.toJSON().data, [0x90, 0x78, 0x56, 0x34, 0x12]);
assert.equal(buf.readUIntLE(0, 5), 0x1234567890);
buf = Buffer.allocUnsafe(5);
buf.writeUIntBE(0x1234567890, 0, 5);
- assert.deepEqual(buf.toJSON().data, [0x12, 0x34, 0x56, 0x78, 0x90]);
+ assert.deepStrictEqual(buf.toJSON().data, [0x12, 0x34, 0x56, 0x78, 0x90]);
assert.equal(buf.readUIntBE(0, 5), 0x1234567890);
buf = Buffer.allocUnsafe(5);
buf.writeIntLE(0x1234567890, 0, 5);
- assert.deepEqual(buf.toJSON().data, [0x90, 0x78, 0x56, 0x34, 0x12]);
+ assert.deepStrictEqual(buf.toJSON().data, [0x90, 0x78, 0x56, 0x34, 0x12]);
assert.equal(buf.readIntLE(0, 5), 0x1234567890);
buf = Buffer.allocUnsafe(5);
buf.writeIntBE(0x1234567890, 0, 5);
- assert.deepEqual(buf.toJSON().data, [0x12, 0x34, 0x56, 0x78, 0x90]);
+ assert.deepStrictEqual(buf.toJSON().data, [0x12, 0x34, 0x56, 0x78, 0x90]);
assert.equal(buf.readIntBE(0, 5), 0x1234567890);
buf = Buffer.allocUnsafe(5);
buf.writeIntLE(-0x1234567890, 0, 5);
- assert.deepEqual(buf.toJSON().data, [0x70, 0x87, 0xa9, 0xcb, 0xed]);
+ assert.deepStrictEqual(buf.toJSON().data, [0x70, 0x87, 0xa9, 0xcb, 0xed]);
assert.equal(buf.readIntLE(0, 5), -0x1234567890);
buf = Buffer.allocUnsafe(5);
buf.writeIntBE(-0x1234567890, 0, 5);
- assert.deepEqual(buf.toJSON().data, [0xed, 0xcb, 0xa9, 0x87, 0x70]);
+ assert.deepStrictEqual(buf.toJSON().data, [0xed, 0xcb, 0xa9, 0x87, 0x70]);
assert.equal(buf.readIntBE(0, 5), -0x1234567890);
buf = Buffer.allocUnsafe(5);
buf.writeIntLE(-0x0012000000, 0, 5);
- assert.deepEqual(buf.toJSON().data, [0x00, 0x00, 0x00, 0xee, 0xff]);
+ assert.deepStrictEqual(buf.toJSON().data, [0x00, 0x00, 0x00, 0xee, 0xff]);
assert.equal(buf.readIntLE(0, 5), -0x0012000000);
buf = Buffer.allocUnsafe(5);
buf.writeIntBE(-0x0012000000, 0, 5);
- assert.deepEqual(buf.toJSON().data, [0xff, 0xee, 0x00, 0x00, 0x00]);
+ assert.deepStrictEqual(buf.toJSON().data, [0xff, 0xee, 0x00, 0x00, 0x00]);
assert.equal(buf.readIntBE(0, 5), -0x0012000000);
})();
}
var utf16Buf = Buffer.from('0123456789', 'utf16le');
- // assert.deepEqual(utf16Buf.slice(0, 6), Buffer.from('012', 'utf16le'));
+ // assert.deepStrictEqual(utf16Buf.slice(0, 6), Buffer.from('012', 'utf16le'));
assert.equal(buf.slice('0', '1'), '0');
assert.equal(buf.slice('-5', '10'), '56789');
// Buffer
+function deepStrictEqualValues(buf, arr) {
+ for (var [index, value] of buf.entries()) {
+ assert.deepStrictEqual(value, arr[index]);
+ }
+}
+
+
var buf2Fill = Buffer.allocUnsafe(1).fill(2);
-assert.deepEqual(genBuffer(4, [buf2Fill]), [2, 2, 2, 2]);
-assert.deepEqual(genBuffer(4, [buf2Fill, 1]), [0, 2, 2, 2]);
-assert.deepEqual(genBuffer(4, [buf2Fill, 1, 3]), [0, 2, 2, 0]);
-assert.deepEqual(genBuffer(4, [buf2Fill, 1, 1]), [0, 0, 0, 0]);
-assert.deepEqual(genBuffer(4, [buf2Fill, 1, -1]), [0, 0, 0, 0]);
+deepStrictEqualValues(genBuffer(4, [buf2Fill]), [2, 2, 2, 2]);
+deepStrictEqualValues(genBuffer(4, [buf2Fill, 1]), [0, 2, 2, 2]);
+deepStrictEqualValues(genBuffer(4, [buf2Fill, 1, 3]), [0, 2, 2, 0]);
+deepStrictEqualValues(genBuffer(4, [buf2Fill, 1, 1]), [0, 0, 0, 0]);
+deepStrictEqualValues(genBuffer(4, [buf2Fill, 1, -1]), [0, 0, 0, 0]);
var hexBufFill = Buffer.allocUnsafe(2).fill(0).fill('0102', 'hex');
-assert.deepEqual(genBuffer(4, [hexBufFill]), [1, 2, 1, 2]);
-assert.deepEqual(genBuffer(4, [hexBufFill, 1]), [0, 1, 2, 1]);
-assert.deepEqual(genBuffer(4, [hexBufFill, 1, 3]), [0, 1, 2, 0]);
-assert.deepEqual(genBuffer(4, [hexBufFill, 1, 1]), [0, 0, 0, 0]);
-assert.deepEqual(genBuffer(4, [hexBufFill, 1, -1]), [0, 0, 0, 0]);
+deepStrictEqualValues(genBuffer(4, [hexBufFill]), [1, 2, 1, 2]);
+deepStrictEqualValues(genBuffer(4, [hexBufFill, 1]), [0, 1, 2, 1]);
+deepStrictEqualValues(genBuffer(4, [hexBufFill, 1, 3]), [0, 1, 2, 0]);
+deepStrictEqualValues(genBuffer(4, [hexBufFill, 1, 1]), [0, 0, 0, 0]);
+deepStrictEqualValues(genBuffer(4, [hexBufFill, 1, -1]), [0, 0, 0, 0]);
// Check exceptions
for (b of buffer)
arr.push(b);
-assert.deepEqual(arr, [1, 2, 3, 4, 5]);
+assert.deepStrictEqual(arr, [1, 2, 3, 4, 5]);
// buffer iterators should be iterable
for (b of buffer[Symbol.iterator]())
arr.push(b);
-assert.deepEqual(arr, [1, 2, 3, 4, 5]);
+assert.deepStrictEqual(arr, [1, 2, 3, 4, 5]);
// buffer#values() should return iterator for values
for (b of buffer.values())
arr.push(b);
-assert.deepEqual(arr, [1, 2, 3, 4, 5]);
+assert.deepStrictEqual(arr, [1, 2, 3, 4, 5]);
// buffer#keys() should return iterator for keys
for (b of buffer.keys())
arr.push(b);
-assert.deepEqual(arr, [0, 1, 2, 3, 4]);
+assert.deepStrictEqual(arr, [0, 1, 2, 3, 4]);
// buffer#entries() should return iterator for entries
for (b of buffer.entries())
arr.push(b);
-assert.deepEqual(arr, [
+assert.deepStrictEqual(arr, [
[0, 1],
[1, 2],
[2, 3],
assert(sb instanceof Buffer);
assert.strictEqual(sb.length, 4);
sb.fill(1);
-assert.deepEqual(sb, ones);
+for (var [key, value] of sb.entries()) {
+ assert.deepStrictEqual(value, ones[key]);
+}
// underlying ArrayBuffer should have the same length
assert.strictEqual(sb.buffer.byteLength, 4);
assert(sb instanceof Buffer);
assert.strictEqual(sb.length, 4);
sb.fill(1);
-assert.deepEqual(sb, ones);
+for (var [key, value] of sb.entries()) {
+ assert.deepStrictEqual(value, ones[key]);
+}
// should work with edge cases
assert.strictEqual(SlowBuffer(0).length, 0);
var ui32 = new Uint32Array(4).fill(42);
var e = Buffer(ui32);
-assert.deepEqual(ui32, e);
+for (var [key, value] of e.entries()) {
+ assert.deepStrictEqual(value, ui32[key]);
+}
// First check Buffer#fill() works as expected.
assert.equal(d[0], 23);
assert.equal(d[1], 42);
assert.equal(d[2], 255);
- assert.deepEqual(d, new Buffer(d));
+ assert.deepStrictEqual(d, new Buffer(d));
}
{
var e = new Buffer('über');
// console.error('uber: \'%s\'', e.toString());
- assert.deepEqual(e, new Buffer([195, 188, 98, 101, 114]));
+ assert.deepStrictEqual(e, new Buffer([195, 188, 98, 101, 114]));
}
{
var f = new Buffer('über', 'ascii');
// console.error('f.length: %d (should be 4)', f.length);
- assert.deepEqual(f, new Buffer([252, 98, 101, 114]));
+ assert.deepStrictEqual(f, new Buffer([252, 98, 101, 114]));
}
['ucs2', 'ucs-2', 'utf16le', 'utf-16le'].forEach(function(encoding) {
{
var f = new Buffer('über', encoding);
// console.error('f.length: %d (should be 8)', f.length);
- assert.deepEqual(f, new Buffer([252, 0, 98, 0, 101, 0, 114, 0]));
+ assert.deepStrictEqual(f, new Buffer([252, 0, 98, 0, 101, 0, 114, 0]));
}
{
var f = new Buffer('привет', encoding);
// console.error('f.length: %d (should be 12)', f.length);
- assert.deepEqual(f, new Buffer([63, 4, 64, 4, 56, 4, 50, 4, 53, 4, 66, 4]));
+ var expected = new Buffer([63, 4, 64, 4, 56, 4, 50, 4, 53, 4, 66, 4]);
+ assert.deepStrictEqual(f, expected);
assert.equal(f.toString(encoding), 'привет');
}
var size = f.write('あいうえお', encoding);
// console.error('bytes written to buffer: %d (should be 4)', size);
assert.equal(size, 4);
- assert.deepEqual(f, new Buffer([0x42, 0x30, 0x44, 0x30, 0x00]));
+ assert.deepStrictEqual(f, new Buffer([0x42, 0x30, 0x44, 0x30, 0x00]));
}
});
{
var f = new Buffer('\uD83D\uDC4D', 'utf-16le'); // THUMBS UP SIGN (U+1F44D)
assert.equal(f.length, 4);
- assert.deepEqual(f, new Buffer('3DD84DDC', 'hex'));
+ assert.deepStrictEqual(f, new Buffer('3DD84DDC', 'hex'));
}
var arrayIsh = {0: 0, 1: 1, 2: 2, 3: 3, length: 4};
var g = new Buffer(arrayIsh);
-assert.deepEqual(g, new Buffer([0, 1, 2, 3]));
+assert.deepStrictEqual(g, new Buffer([0, 1, 2, 3]));
var strArrayIsh = {0: '0', 1: '1', 2: '2', 3: '3', length: 4};
g = new Buffer(strArrayIsh);
-assert.deepEqual(g, new Buffer([0, 1, 2, 3]));
+assert.deepStrictEqual(g, new Buffer([0, 1, 2, 3]));
//
{
// test that regular and URL-safe base64 both work
var expected = [0xff, 0xff, 0xbe, 0xff, 0xef, 0xbf, 0xfb, 0xef, 0xff];
- assert.deepEqual(Buffer('//++/++/++//', 'base64'), Buffer(expected));
- assert.deepEqual(Buffer('__--_--_--__', 'base64'), Buffer(expected));
+ assert.deepStrictEqual(Buffer('//++/++/++//', 'base64'), Buffer(expected));
+ assert.deepStrictEqual(Buffer('__--_--_--__', 'base64'), Buffer(expected));
}
{
'********************');
// handle padding graciously, multiple-of-4 or not
-assert.equal(new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw==',
- 'base64').length, 32);
-assert.equal(new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw=',
- 'base64').length, 32);
-assert.equal(new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw',
- 'base64').length, 32);
-assert.equal(new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg==',
- 'base64').length, 31);
-assert.equal(new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg=',
- 'base64').length, 31);
-assert.equal(new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg',
- 'base64').length, 31);
+assert.equal(
+ new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw==', 'base64').length,
+ 32
+);
+assert.equal(
+ new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw=', 'base64').length,
+ 32
+);
+assert.equal(
+ new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw', 'base64').length,
+ 32
+);
+assert.equal(
+ new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg==', 'base64').length,
+ 31
+);
+assert.equal(
+ new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg=', 'base64').length,
+ 31
+);
+assert.equal(
+ new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg', 'base64').length,
+ 31
+);
// This string encodes single '.' character in UTF-16
var dot = new Buffer('//4uAA==', 'base64');
assert.equal(string, '{"type":"Buffer","data":[116,101,115,116]}');
- assert.deepEqual(buffer, JSON.parse(string, function(key, value) {
+ assert.deepStrictEqual(buffer, JSON.parse(string, function(key, value) {
return value && value.type === 'Buffer'
? new Buffer(value.data)
: value;
(function() {
var buf = Buffer(3);
buf.writeUIntLE(0x123456, 0, 3);
- assert.deepEqual(buf.toJSON().data, [0x56, 0x34, 0x12]);
+ assert.deepStrictEqual(buf.toJSON().data, [0x56, 0x34, 0x12]);
assert.equal(buf.readUIntLE(0, 3), 0x123456);
buf = Buffer(3);
buf.writeUIntBE(0x123456, 0, 3);
- assert.deepEqual(buf.toJSON().data, [0x12, 0x34, 0x56]);
+ assert.deepStrictEqual(buf.toJSON().data, [0x12, 0x34, 0x56]);
assert.equal(buf.readUIntBE(0, 3), 0x123456);
buf = Buffer(3);
buf.writeIntLE(0x123456, 0, 3);
- assert.deepEqual(buf.toJSON().data, [0x56, 0x34, 0x12]);
+ assert.deepStrictEqual(buf.toJSON().data, [0x56, 0x34, 0x12]);
assert.equal(buf.readIntLE(0, 3), 0x123456);
buf = Buffer(3);
buf.writeIntBE(0x123456, 0, 3);
- assert.deepEqual(buf.toJSON().data, [0x12, 0x34, 0x56]);
+ assert.deepStrictEqual(buf.toJSON().data, [0x12, 0x34, 0x56]);
assert.equal(buf.readIntBE(0, 3), 0x123456);
buf = Buffer(3);
buf.writeIntLE(-0x123456, 0, 3);
- assert.deepEqual(buf.toJSON().data, [0xaa, 0xcb, 0xed]);
+ assert.deepStrictEqual(buf.toJSON().data, [0xaa, 0xcb, 0xed]);
assert.equal(buf.readIntLE(0, 3), -0x123456);
buf = Buffer(3);
buf.writeIntBE(-0x123456, 0, 3);
- assert.deepEqual(buf.toJSON().data, [0xed, 0xcb, 0xaa]);
+ assert.deepStrictEqual(buf.toJSON().data, [0xed, 0xcb, 0xaa]);
assert.equal(buf.readIntBE(0, 3), -0x123456);
buf = Buffer(3);
buf.writeIntLE(-0x123400, 0, 3);
- assert.deepEqual(buf.toJSON().data, [0x00, 0xcc, 0xed]);
+ assert.deepStrictEqual(buf.toJSON().data, [0x00, 0xcc, 0xed]);
assert.equal(buf.readIntLE(0, 3), -0x123400);
buf = Buffer(3);
buf.writeIntBE(-0x123400, 0, 3);
- assert.deepEqual(buf.toJSON().data, [0xed, 0xcc, 0x00]);
+ assert.deepStrictEqual(buf.toJSON().data, [0xed, 0xcc, 0x00]);
assert.equal(buf.readIntBE(0, 3), -0x123400);
buf = Buffer(3);
buf.writeIntLE(-0x120000, 0, 3);
- assert.deepEqual(buf.toJSON().data, [0x00, 0x00, 0xee]);
+ assert.deepStrictEqual(buf.toJSON().data, [0x00, 0x00, 0xee]);
assert.equal(buf.readIntLE(0, 3), -0x120000);
buf = Buffer(3);
buf.writeIntBE(-0x120000, 0, 3);
- assert.deepEqual(buf.toJSON().data, [0xee, 0x00, 0x00]);
+ assert.deepStrictEqual(buf.toJSON().data, [0xee, 0x00, 0x00]);
assert.equal(buf.readIntBE(0, 3), -0x120000);
buf = Buffer(5);
buf.writeUIntLE(0x1234567890, 0, 5);
- assert.deepEqual(buf.toJSON().data, [0x90, 0x78, 0x56, 0x34, 0x12]);
+ assert.deepStrictEqual(buf.toJSON().data, [0x90, 0x78, 0x56, 0x34, 0x12]);
assert.equal(buf.readUIntLE(0, 5), 0x1234567890);
buf = Buffer(5);
buf.writeUIntBE(0x1234567890, 0, 5);
- assert.deepEqual(buf.toJSON().data, [0x12, 0x34, 0x56, 0x78, 0x90]);
+ assert.deepStrictEqual(buf.toJSON().data, [0x12, 0x34, 0x56, 0x78, 0x90]);
assert.equal(buf.readUIntBE(0, 5), 0x1234567890);
buf = Buffer(5);
buf.writeIntLE(0x1234567890, 0, 5);
- assert.deepEqual(buf.toJSON().data, [0x90, 0x78, 0x56, 0x34, 0x12]);
+ assert.deepStrictEqual(buf.toJSON().data, [0x90, 0x78, 0x56, 0x34, 0x12]);
assert.equal(buf.readIntLE(0, 5), 0x1234567890);
buf = Buffer(5);
buf.writeIntBE(0x1234567890, 0, 5);
- assert.deepEqual(buf.toJSON().data, [0x12, 0x34, 0x56, 0x78, 0x90]);
+ assert.deepStrictEqual(buf.toJSON().data, [0x12, 0x34, 0x56, 0x78, 0x90]);
assert.equal(buf.readIntBE(0, 5), 0x1234567890);
buf = Buffer(5);
buf.writeIntLE(-0x1234567890, 0, 5);
- assert.deepEqual(buf.toJSON().data, [0x70, 0x87, 0xa9, 0xcb, 0xed]);
+ assert.deepStrictEqual(buf.toJSON().data, [0x70, 0x87, 0xa9, 0xcb, 0xed]);
assert.equal(buf.readIntLE(0, 5), -0x1234567890);
buf = Buffer(5);
buf.writeIntBE(-0x1234567890, 0, 5);
- assert.deepEqual(buf.toJSON().data, [0xed, 0xcb, 0xa9, 0x87, 0x70]);
+ assert.deepStrictEqual(buf.toJSON().data, [0xed, 0xcb, 0xa9, 0x87, 0x70]);
assert.equal(buf.readIntBE(0, 5), -0x1234567890);
buf = Buffer(5);
buf.writeIntLE(-0x0012000000, 0, 5);
- assert.deepEqual(buf.toJSON().data, [0x00, 0x00, 0x00, 0xee, 0xff]);
+ assert.deepStrictEqual(buf.toJSON().data, [0x00, 0x00, 0x00, 0xee, 0xff]);
assert.equal(buf.readIntLE(0, 5), -0x0012000000);
buf = Buffer(5);
buf.writeIntBE(-0x0012000000, 0, 5);
- assert.deepEqual(buf.toJSON().data, [0xff, 0xee, 0x00, 0x00, 0x00]);
+ assert.deepStrictEqual(buf.toJSON().data, [0xff, 0xee, 0x00, 0x00, 0x00]);
assert.equal(buf.readIntBE(0, 5), -0x0012000000);
})();
}
var utf16Buf = new Buffer('0123456789', 'utf16le');
- // assert.deepEqual(utf16Buf.slice(0, 6), Buffer('012', 'utf16le'));
+ // assert.deepStrictEqual(utf16Buf.slice(0, 6), Buffer('012', 'utf16le'));
assert.equal(buf.slice('0', '1'), '0');
assert.equal(buf.slice('-5', '10'), '56789');