Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: increase test coverage of BufferList #10171

Closed
wants to merge 1 commit into from

Conversation

joyeecheung
Copy link
Member

Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

test

Description of change

Add tests for edges cases of BufferList

  • test operations when the length is 0
  • test operations when the list only has one element

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Dec 7, 2016
@joyeecheung joyeecheung force-pushed the test-buffer-list branch 3 times, most recently from 887e1ea to 4842402 Compare December 7, 2016 20:00
@mscdex mscdex added the stream Issues and PRs related to the stream subsystem. label Dec 7, 2016
Copy link
Contributor

@Fishrock123 Fishrock123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// Flags: --expose_internals
'use strict';
require('../common');
var assert = require('assert');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind to use const/let? :D

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out. Addressed.

assert.deepStrictEqual(emptyList.concat(0), Buffer.alloc(0));

// Test buffer list with one element.
var list = new BufferList();
Copy link
Contributor

@italoacasas italoacasas Dec 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit const/let

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out. Addressed.


assert.strictEqual(list.join(','), 'foo');

var shifted = list.shift();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit const/let

@Trott
Copy link
Member

Trott commented Dec 7, 2016

CI: https://ci.nodejs.org/job/node-test-pull-request/5296/

EDIT: Whoops, CI was already run. Sorry for the duplicate. It was ✅ green already...

Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once it's moved to const and let.

Add tests for edges cases of BufferList

- test operations when the length is 0
- test operations when the list only has one element
@joyeecheung
Copy link
Member Author

Thank you for the review, I've updated the vars.

@addaleax
Copy link
Member

addaleax commented Dec 8, 2016

@italoacasas
Copy link
Contributor

Landed f0da38a

Thanks for the contribution.

@italoacasas italoacasas closed this Dec 8, 2016
@addaleax
Copy link
Member

addaleax commented Dec 8, 2016

@italoacasas I don’t think this is a problem in this case but try to keep the 48/72 hour rule for landing PRs in mind :)

Fishrock123 pushed a commit that referenced this pull request Dec 13, 2016
Add tests for edges cases of BufferList:
- test operations when the length is 0
- test operations when the list only has one element

PR-URL: #10171
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@italoacasas italoacasas mentioned this pull request Dec 15, 2016
@joyeecheung joyeecheung deleted the test-buffer-list branch December 15, 2016 14:25
MylesBorins pushed a commit that referenced this pull request Jan 16, 2017
Add tests for edges cases of BufferList:
- test operations when the length is 0
- test operations when the list only has one element

PR-URL: #10171
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
MylesBorins pushed a commit that referenced this pull request Jan 24, 2017
Add tests for edges cases of BufferList:
- test operations when the length is 0
- test operations when the list only has one element

PR-URL: #10171
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@MylesBorins MylesBorins mentioned this pull request Jan 24, 2017
MylesBorins pushed a commit that referenced this pull request Jan 31, 2017
Add tests for edges cases of BufferList:
- test operations when the length is 0
- test operations when the list only has one element

PR-URL: #10171
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stream Issues and PRs related to the stream subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants