mirror of
https://github.com/nodejs/node.git
synced 2025-05-20 02:55:51 +00:00

Enable linting for the test directory. A number of changes was made so all tests conform the current rules used by lib and src directories. The only exception for tests is that unreachable (dead) code is allowed. test-fs-non-number-arguments-throw had to be excluded from the changes because of a weird issue on Windows CI. PR-URL: https://github.com/nodejs/io.js/pull/1721 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
22 lines
611 B
JavaScript
22 lines
611 B
JavaScript
'use strict';
|
|
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');
|