Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
test: fix details in diff to node/master
Browse files Browse the repository at this point in the history
Deleted files were deleted in node/master in 47f8f74.

Tests for GH-7849 and GH-5110 were moved from test-buffer-alloc to
test-buffer-tojson in f3dc6a3.

PR-URL: #233
Reviewed-By: Sandeep Agarwal <saagarwa@microsoft.com>
Reviewed-By: Kyle Farnung <kfarnung@microsoft.com>
Reviewed-By: Kunal Pathak <Kunal.Pathak@microsoft.com>
  • Loading branch information
joaocgreis committed May 10, 2017
1 parent 4751de5 commit 32b144d
Show file tree
Hide file tree
Showing 16 changed files with 17 additions and 633 deletions.
27 changes: 0 additions & 27 deletions test/parallel/test-buffer-alloc.js
Original file line number Diff line number Diff line change
Expand Up @@ -780,32 +780,6 @@ assert.strictEqual(Buffer.from('13.37').length, 5);
// issue GH-3416
Buffer.from(Buffer.allocUnsafe(0), 0, 0);

// GH-5110
{
const buffer = Buffer.from('test');
const string = JSON.stringify(buffer);

assert.strictEqual(string, '{"type":"Buffer","data":[116,101,115,116]}');

assert.deepStrictEqual(buffer, JSON.parse(string, (key, value) => {
return value && value.type === 'Buffer' ?
Buffer.from(value.data) :
value;
}));
}

// issue GH-7849
{
const buf = Buffer.from('test');
const json = JSON.stringify(buf);
const obj = JSON.parse(json);
const copy = Buffer.from(obj);

assert(buf.equals(copy));
}
assert.throws(() => Buffer.allocUnsafe(0xFFFFFFFF), RangeError);
assert.throws(() => Buffer.allocUnsafe(0xFFFFFFFFF), RangeError);

// issue GH-5587
assert.throws(() => Buffer.alloc(8).writeFloatLE(0, 5), RangeError);
assert.throws(() => Buffer.alloc(16).writeDoubleLE(0, 9), RangeError);
Expand Down Expand Up @@ -934,7 +908,6 @@ assert.throws(() => Buffer.from('', 'buffer'),
}
}


if (common.hasCrypto) {
// Test truncation after decode
const crypto = require('crypto');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-buffer-slow.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ assert.strictEqual(SlowBuffer(NaN).length, 0);
assert.strictEqual(SlowBuffer({}).length, 0);
assert.strictEqual(SlowBuffer('string').length, 0);

// should throw with invalid length
assert.throws(function() {
SlowBuffer(Infinity);
}, common.bufferMaxSizeMsg);

assert.throws(function() {
SlowBuffer(-1);
}, /^RangeError: "size" argument must not be negative$/);
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-child-process-double-pipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const util = require('util');
const spawn = require('child_process').spawn;

// We're trying to reproduce:
// $ echo "hello\nnode\nand\nworld" | grep o | sed s/o/O/
// $ echo "hello\nnode\nand\nworld" | grep o | sed s/o/a/

let grep, sed, echo;

Expand Down
19 changes: 0 additions & 19 deletions test/parallel/test-debug-brk-no-arg.js

This file was deleted.

76 changes: 0 additions & 76 deletions test/parallel/test-debug-brk.js

This file was deleted.

33 changes: 0 additions & 33 deletions test/parallel/test-debug-no-context.js

This file was deleted.

59 changes: 0 additions & 59 deletions test/parallel/test-debug-port-cluster.js

This file was deleted.

70 changes: 0 additions & 70 deletions test/parallel/test-debug-port-from-cmdline.js

This file was deleted.

65 changes: 0 additions & 65 deletions test/parallel/test-debug-port-numbers.js

This file was deleted.

Loading

0 comments on commit 32b144d

Please sign in to comment.