Lines Matching defs:length
13 { message: 'Invalid typed array length: 4294967297' }
17 assert.strictEqual(b.length, 1024);
31 assert.strictEqual(c.length, 512);
34 assert.strictEqual(d.length, 0);
39 assert.strictEqual(b.length, 128);
90 // Try to create 0-length buffers. Should not throw.
107 // Try to write a 0-length string beyond the end of b
152 for (let i = 0; i < asciiString.length; i++) {
155 const asciiSlice = b.toString('ascii', 0, asciiString.length);
163 assert.strictEqual(asciiString.length, b.write(asciiString, offset, 'ascii'));
164 const asciiSlice = b.toString('ascii', offset, offset + asciiString.length);
172 const sliceA = b.slice(offset, offset + asciiString.length);
173 const sliceB = b.slice(offset, offset + asciiString.length);
174 for (let i = 0; i < asciiString.length; i++) {
203 assert.strictEqual(slice.length, 50);
251 assert.strictEqual(d.length, 3);
265 // Test for proper ascii Encoding, length should be 4
272 // Test for proper UTF16LE encoding, length should be 8
288 assert.strictEqual(f.length, 5);
297 assert.strictEqual(f.length, 4);
303 const arrayIsh = { 0: 0, 1: 1, 2: 2, 3: 3, length: 4 };
306 const strArrayIsh = { 0: '0', 1: '1', 2: '2', 3: '3', length: 4 };
374 assert.strictEqual(quote.length, bytesWritten);
375 assert.strictEqual(quote, b.toString('ascii', 0, quote.length));
386 assert.strictEqual(quote.length, bytesWritten);
387 assert.strictEqual(quote, b.toString('ascii', 0, quote.length));
392 assert.strictEqual(quote.length, b.length);
393 assert.strictEqual(quote, b.toString('ascii', 0, quote.length));
403 assert.strictEqual(quote.length, b.length);
404 assert.strictEqual(quote, b.toString('ascii', 0, quote.length));
489 Buffer.from('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw==', 'base64').length,
494 .length,
498 Buffer.from('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw=', 'base64').length,
503 .length,
507 Buffer.from('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw', 'base64').length,
512 .length,
516 Buffer.from('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg==', 'base64').length,
521 .length,
525 Buffer.from('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg=', 'base64').length,
530 .length,
534 Buffer.from('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg', 'base64').length,
538 Buffer.from('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg', 'base64url').length,
570 for (let i = 0; i < segments.length; ++i) {
585 for (let i = 0; i < segments.length; ++i) {
593 assert.strictEqual(Buffer.from('=bad'.repeat(1e4), 'base64').length, 0);
614 assert.strictEqual(sb.length, s.length);
650 assert.strictEqual(Buffer.from('A', 'hex').length, 0);
656 assert.strictEqual(Buffer.from('A', 'base64').length, 0);
671 const buffer = Buffer.allocUnsafe(data.length);
684 assert.strictEqual(z.length, 5);
694 assert.strictEqual(z.length, x.length);
699 assert.strictEqual(z.length, 4);
706 assert.strictEqual(z.length, 9);
711 assert.strictEqual(z.length, 3);
717 assert.strictEqual(z.length, 2);
772 assert.strictEqual(buf.length, 1);
774 assert.strictEqual(buf.length, 2);
861 const buf = Buffer.from([0, 0, 0, 0, 0]); // length: 5
862 const sub = buf.slice(0, 4); // length: 4
880 // Check for fractional length args, junk length args, etc.
887 assert.strictEqual(Buffer.allocUnsafe(3.3).length, 3);
888 assert.strictEqual(Buffer.from({ length: 3.3 }).length, 3);
889 assert.strictEqual(Buffer.from({ length: 'BAM' }).length, 0);
892 assert.strictEqual(Buffer.from('99').length, 2);
893 assert.strictEqual(Buffer.from('13.37').length, 5);
895 // Ensure that the length argument is respected.
1052 assert.strictEqual(b.length, a.length);
1053 assert.strictEqual(c.length, a.length);
1054 for (let i = 0, k = a.length; i < k; ++i) {
1109 // Test that large negative Buffer length inputs don't affect the pool offset.
1111 // about its input and passes the length directly to allocate().
1112 assert.deepStrictEqual(Buffer.from({ length: -Buffer.poolSize }),
1114 assert.deepStrictEqual(Buffer.from({ length: -100 }),