Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update regex to check for invalid version
  • Loading branch information
danbev committed Jun 16, 2017
commit b9833a1da110a44ddd3bbe9cfcee8002d7bb7ae9
2 changes: 1 addition & 1 deletion test/parallel/test-zlib-failed-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const zlib = require('zlib');
// This check was introduced in vesion 1.2.9 and prior to that there was
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

version

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I'll fix this.

// no such rejection which is the reason for the version check below
// (http://zlib.net/ChangeLog.txt).
if (/^\d+\.\d+\.[9]|\d{2,}$/.test(process.versions.zlib)) {
if ((/^(?!1\.2\.[0-8]$)/.test(process.versions.zlib))) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Isn’t this equivalent to (!/^1\.2\.[0-8]$/.test(process.versions.zlib))? That would look a bit simpler to me.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I was choosing between the both and had a trouble making up my mind. I'd be happy to change it.

assert.throws(() => {
zlib.createDeflateRaw({ windowBits: 8 });
}, /^Error: Init error$/);
Expand Down