1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

Fix: do not stop parsing a chunk if the first character is a line break

Add changelog entry
This commit is contained in:
Ruben Bridgewater
2015-10-27 11:13:43 +01:00
parent 9b3b090119
commit 5d08132f7c
3 changed files with 7 additions and 8 deletions

View File

@@ -55,7 +55,7 @@ describe('parsers', function () {
return done();
});
it('line breaks in the beginning', function (done) {
it('line breaks in the beginning of the last chunk', function (done) {
var parser = new Parser();
var reply_count = 0;
function check_reply(reply) {
@@ -68,10 +68,7 @@ describe('parsers', function () {
parser.execute(new Buffer('*1\r\n*1\r\n$1\r\na'));
parser.execute(new Buffer('\r\n*1\r\n*1\r'));
parser.execute(new Buffer('\n$1\r\na\r\n'));
parser.execute(new Buffer('*1\r\n*1\r\n'));
parser.execute(new Buffer('$1\r\na\r\n'));
parser.execute(new Buffer('\n$1\r\na\r\n*1\r\n*1\r\n$1\r\na\r\n'));
assert.equal(reply_count, 3, "check reply should have been called three times");
return done();