GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: increase buffer list coverage · nodejs/node@951a78b

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-stream-buffer-list.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-stream-buffer-list.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-stream-buffer-list.js
+34Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,37 @@ const shifted = list.shift();
4848
testIterator(list, 0);
4949
assert.strictEqual(shifted, buf);
5050
assert.deepStrictEqual(list, new BufferList());
51+
52+
{
53+
const list = new BufferList();
54+
list.push('foo');
55+
list.push('bar');
56+
list.push('foo');
57+
list.push('bar');
58+
assert.strictEqual(list.consume(6, true), 'foobar');
59+
assert.strictEqual(list.consume(6, true), 'foobar');
60+
}
61+
62+
{
63+
const list = new BufferList();
64+
list.push('foo');
65+
list.push('bar');
66+
assert.strictEqual(list.consume(5, true), 'fooba');
67+
}
68+
69+
{
70+
const list = new BufferList();
71+
list.push(buf);
72+
list.push(buf);
73+
list.push(buf);
74+
list.push(buf);
75+
assert.strictEqual(list.consume(6).toString(), 'foofoo');
76+
assert.strictEqual(list.consume(6).toString(), 'foofoo');
77+
}
78+
79+
{
80+
const list = new BufferList();
81+
list.push(buf);
82+
list.push(buf);
83+
assert.strictEqual(list.consume(5).toString(), 'foofo');
84+
}

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.