files.forEach(function (file) {
if (!/test-buffer.*/.test(file.name)) return
+ var path
+ if (file.name !== 'test-buffer-iterator.js')
+ path = __dirname + '/../test/node/' + file.name
+ else
+ path = __dirname + '/../test/es6/' + file.name
+
hyperquest(file.download_url, httpOpts)
.pipe(split())
.pipe(testfixer(file.name))
- .pipe(fs.createWriteStream(__dirname + '/../test/node-' + file.name))
+ .pipe(fs.createWriteStream(path))
})
}
line = line.toString()
if (firstline) {
- var originalLine = line
// require buffer explicitly
- line = 'var Buffer = require(\'../\').Buffer\n'
-
- // don't run this test for the Object-based bufer implementation because
- // it doesn't have an Iterable interface (but these old browsers won't have it
- // anyway)
- if (filename === 'test-buffer-iterator.js')
- line += 'if (process.env.OBJECT_IMPL) return\n'
- else
- line += 'if (process.env.OBJECT_IMPL) Buffer.TYPED_ARRAY_SUPPORT = false\n'
-
- line += originalLine
+ line = 'var Buffer = require(\'../../\').Buffer\nif (process.env.OBJECT_IMPL) Buffer.TYPED_ARRAY_SUPPORT = false\n' + line
firstline = false
}
line = line.replace(/(var common = require.*)/, '// $1')
// require browser buffer
- line = line.replace(/(.*)require\('buffer'\)(.*)/, '$1require(\'../\')$2')
+ line = line.replace(/(.*)require\('buffer'\)(.*)/, '$1require(\'../../\')$2')
// smalloc is only used for kMaxLength
line = line.replace(/require\('smalloc'\)/, '{ kMaxLength: 0x3FFFFFFF }')
},
"scripts": {
"test": "standard && node ./bin/test.js",
- "test-browser": "zuul -- test/*.js",
- "test-browser-local": "zuul --local -- test/*.js",
- "test-node": "tape test/*.js && OBJECT_IMPL=true tape test/*.js",
+ "test-browser": "zuul -- test/*.js test/node/*.js",
+ "test-browser-local": "zuul --local -- test/*.js test/node/*.js",
+ "test-node": "tape test/*.js test/node/*.js test/es6/*.js && OBJECT_IMPL=true tape test/*.js test/node/*.js",
"perf": "browserify --debug perf/bracket-notation.js > perf/bundle.js && open perf/index.html",
"perf-node": "node perf/bracket-notation.js && node perf/concat.js && node perf/copy-big.js && node perf/copy.js && node perf/new-big.js && node perf/new.js && node perf/readDoubleBE.js && node perf/readFloatBE.js && node perf/readUInt32LE.js && node perf/slice.js && node perf/writeFloatBE.js",
"size": "browserify -r ./ | uglifyjs -c -m | gzip | wc -c"
},
"standard": {
"ignore": [
- "test/node-*",
- "perf/*"
+ "test/node/*.js",
+ "test/es6/*.js",
+ "perf/*.js"
]
},
"testling": {
--- /dev/null
+io.js/node.js core buffer tests that require ES6 (for..of construct)
-var Buffer = require('../').Buffer
+var Buffer = require('../../').Buffer
if (process.env.OBJECT_IMPL) return
// var common = require('../common');
var assert = require('assert');
--- /dev/null
+io.js/node.js core buffer tests
-var Buffer = require('../').Buffer
+var Buffer = require('../../').Buffer
if (process.env.OBJECT_IMPL) Buffer.TYPED_ARRAY_SUPPORT = false
// var common = require('../common');
var assert = require('assert');
if (input.charCodeAt(i) > 65535) ++i;
if (input.charCodeAt(i) > 127) ++i;
}
-
-var Buffer = require('../').Buffer
+var Buffer = require('../../').Buffer
if (process.env.OBJECT_IMPL) Buffer.TYPED_ARRAY_SUPPORT = false
// var common = require('../common');
var assert = require('assert');
-var Buffer = require('../').Buffer
+var Buffer = require('../../').Buffer
if (process.env.OBJECT_IMPL) Buffer.TYPED_ARRAY_SUPPORT = false
// var common = require('../common');
var assert = require('assert');
-var Buffer = require('../').Buffer
+var Buffer = require('../../').Buffer
if (process.env.OBJECT_IMPL) Buffer.TYPED_ARRAY_SUPPORT = false
// var common = require('../common');
var assert = require('assert');
var util = require('util');
-var buffer = require('../');
+var buffer = require('../../');
buffer.INSPECT_MAX_BYTES = 2;
-var Buffer = require('../').Buffer
+var Buffer = require('../../').Buffer
if (process.env.OBJECT_IMPL) Buffer.TYPED_ARRAY_SUPPORT = false
// var common = require('../common');
var assert = require('assert');
-var Buffer = require('../').Buffer;
+var Buffer = require('../../').Buffer;
var buff = new Buffer(Buffer.poolSize + 1);
var slicedBuffer = buff.slice();
-var Buffer = require('../').Buffer
+var Buffer = require('../../').Buffer
if (process.env.OBJECT_IMPL) Buffer.TYPED_ARRAY_SUPPORT = false
// var common = require('../common');
var assert = require('assert');
-var Buffer = require('../').Buffer;
-var SlowBuffer = require('../').SlowBuffer;
+var Buffer = require('../../').Buffer;
+var SlowBuffer = require('../../').SlowBuffer;
var smalloc = { kMaxLength: 0x3FFFFFFF };
// counter to ensure unique value is always copied
// Regression test for https://github.com/iojs/io.js/issues/649.
assert.throws(function() { Buffer(1422561062959).toString('utf8'); });
+