Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dbaec6d

Browse filesBrowse files
committed
Fixed parser test on all node-versions
In the past we were relying on the fact that invalid utf8 sequences would not effect the length of the new buffer. We need to explictely declare the binary string type if we want to create a buffer with a 0 byte.
1 parent eb46be9 commit dbaec6d
Copy full SHA for dbaec6d

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎test/simple/test-parser.js

Copy file name to clipboardExpand all lines: test/simple/test-parser.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ test(function write() {
5858
assert.equal(parser.state, Parser.GREETING_SERVER_VERSION);
5959

6060
var VERSION = 'MySql 5.1';
61-
parser.write(new Buffer(VERSION+'\0\0'));
61+
parser.write(new Buffer(VERSION+'\0', 'binary'));
6262
assert.equal(packet.serverVersion, VERSION);
6363
assert.equal(parser.state, Parser.GREETING_THREAD_ID);
6464

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.