mirror of
https://github.com/nodejs/node.git
synced 2024-11-25 08:19:38 +01:00
3e1b1dd4a9
The copyright and license notice is already in the LICENSE file. There is no justifiable reason to also require that it be included in every file, since the individual files are not individually distributed except as part of the entire package.
21 lines
593 B
JavaScript
21 lines
593 B
JavaScript
var common = require('../common');
|
|
var assert = require('assert');
|
|
|
|
var zero = [];
|
|
var one = [ new Buffer('asdf') ];
|
|
var long = [];
|
|
for (var i = 0; i < 10; i++) long.push(new Buffer('asdf'));
|
|
|
|
var flatZero = Buffer.concat(zero);
|
|
var flatOne = Buffer.concat(one);
|
|
var flatLong = Buffer.concat(long);
|
|
var flatLongLen = Buffer.concat(long, 40);
|
|
|
|
assert(flatZero.length === 0);
|
|
assert(flatOne.toString() === 'asdf');
|
|
assert(flatOne === one[0]);
|
|
assert(flatLong.toString() === (new Array(10+1).join('asdf')));
|
|
assert(flatLongLen.toString() === (new Array(10+1).join('asdf')));
|
|
|
|
console.log("ok");
|