mirror of
https://gitee.com/dcloud/uni-preset-vue
synced 2026-04-22 00:00:04 +08:00
add node_modules
This commit is contained in:
+30
@@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
if (process.env.OBJECT_IMPL) global.TYPED_ARRAY_SUPPORT = false;
|
||||
var Buffer = require('../../').Buffer;
|
||||
var 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');
|
||||
// A special case where concat used to return the first item,
|
||||
// if the length is one. This check is to make sure that we don't do that.
|
||||
assert(flatOne !== one[0]);
|
||||
assert(flatLong.toString() === (new Array(10 + 1).join('asdf')));
|
||||
assert(flatLongLen.toString() === (new Array(10 + 1).join('asdf')));
|
||||
|
||||
assert.throws(function() {
|
||||
Buffer.concat([42]);
|
||||
}, TypeError);
|
||||
|
||||
// console.log('ok');
|
||||
|
||||
Reference in New Issue
Block a user