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 coverage of buffer #11122

Closed
wants to merge 1 commit into from

Conversation

@DavidCai1993
Copy link
Member

commented Feb 2, 2017

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

test

@hiroppy hiroppy added the buffer label Feb 2, 2017

test/parallel/test-buffer-write-noassert.js Outdated
() => Buffer.alloc(9)[funx].apply(new Uint32Array(1), args),
new RegExp('^TypeError: (?:"buffer" )?argument (must|should) be ' +
'a Buffer(?: or Uint8Array)?$')
);

This comment has been minimized.

Copy link
@joyeecheung

joyeecheung Feb 2, 2017

Member

Something like

const error = /Int/.test(funx) ?
  /^TypeError: "buffer" argument must be a Buffer or Uint8Array$/ :
  /^TypeError: argument should be a Buffer$/;

assert.throws(
  () => Buffer.alloc(9)[funx].apply(new Uint32Array(1), args),
  error
);

would probably be easier to read.

@jasnell
jasnell approved these changes Feb 2, 2017
Copy link
Member

left a comment

LGTM with @joyeecheung's formatting suggestion

@DavidCai1993 DavidCai1993 force-pushed the DavidCai1993:master branch to 0d41151 Feb 3, 2017

@DavidCai1993

This comment has been minimized.

Copy link
Member Author

commented Feb 3, 2017

OK, updated.

@italoacasas

This comment has been minimized.

@hiroppy
hiroppy approved these changes Feb 3, 2017
jasnell added a commit that referenced this pull request Feb 6, 2017
test: increase coverage of buffer
PR-URL: #11122
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
@jasnell

This comment has been minimized.

Copy link
Member

commented Feb 6, 2017

Landed in 901cb8c

@jasnell jasnell closed this Feb 6, 2017

@italoacasas

This comment has been minimized.

Copy link
Member

commented Feb 9, 2017

This is failing in v7.x, maybe because of some semver-major in buffer. Any plan to backport this?

@joyeecheung

This comment has been minimized.

Copy link
Member

commented Feb 9, 2017

This depends on semver-major #10236 which adds support for Uint8Array input to buffer methods. Should be manually backportable though. @DavidCai1993 mind submitting a backport for this?

@DavidCai1993

This comment has been minimized.

Copy link
Member Author

commented Feb 10, 2017

OK

italoacasas added a commit that referenced this pull request Feb 16, 2017
test: increase coverage of buffer
PR-URL: #11312
Backport-of: #11122
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
italoacasas added a commit that referenced this pull request Feb 22, 2017
test: increase coverage of buffer
PR-URL: #11312
Backport-of: #11122
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
KryDos added a commit to KryDos/node that referenced this pull request Feb 25, 2017
test: increase coverage of buffer
PR-URL: nodejs#11122
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
@jasnell jasnell referenced this pull request Apr 4, 2017
@gibfahn gibfahn referenced this pull request Jun 15, 2017
2 of 3 tasks complete
@gibfahn

This comment has been minimized.

Copy link
Member

commented Jun 17, 2017

Adding dont-land-on-v6.x due to #11312 (comment), @DavidCai1993 if you think this should be backported please raise a PR (see the backporting guide for the howto.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants
You can’t perform that action at this time.