@@ -141,7 +141,7 @@ describe('parsers', function () {
141
141
'Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ' +
142
142
'ut aliquip ex ea commodo consequat. Duis aute irure dolor in' // 256 chars
143
143
var bigStringArray = ( new Array ( Math . pow ( 2 , 16 ) / lorem . length ) . join ( lorem + ' ' ) ) . split ( ' ' ) // Math.pow(2, 16) chars long
144
- var startBigBuffer = new Buffer ( str + '$' + ( size ) + '\r\n' )
144
+ var startBigBuffer = new Buffer ( str + '$' + size + '\r\n' )
145
145
var parts = size / 65536
146
146
var chunks = new Array ( parts )
147
147
parser . execute ( startBigBuffer )
@@ -196,15 +196,13 @@ describe('parsers', function () {
196
196
createBufferOfSize ( parser , size * 11 )
197
197
createBufferOfSize ( parser , size , '\r\n' )
198
198
parser . execute ( new Buffer ( '\r\n' ) )
199
- setTimeout ( function ( ) {
200
- done ( )
201
- } , 500 )
199
+ setTimeout ( done , 425 )
202
200
} )
203
201
204
202
it ( 'multiple parsers do not interfere' , function ( ) {
205
203
var results = [ 1234567890 , 'foo bar baz' , 'hello world' ]
206
204
function checkReply ( reply ) {
207
- assert . strictEqual ( results [ replyCount ] , reply )
205
+ assert . strictEqual ( reply , results [ replyCount ] )
208
206
replyCount ++
209
207
}
210
208
var parserOne = newParser ( checkReply )
@@ -224,7 +222,7 @@ describe('parsers', function () {
224
222
it ( 'multiple parsers do not interfere with bulk strings in arrays' , function ( ) {
225
223
var results = [ [ 'foo' , 'foo bar baz' ] , [ 1234567890 , 'hello world' , 'the end' ] , 'ttttttttttttttttttttttttttttttttttttttttttttttt' ]
226
224
function checkReply ( reply ) {
227
- assert . deepEqual ( results [ replyCount ] , reply )
225
+ assert . deepEqual ( reply , results [ replyCount ] )
228
226
replyCount ++
229
227
}
230
228
var parserOne = newParser ( checkReply )
@@ -273,7 +271,7 @@ describe('parsers', function () {
273
271
var bigString = ( new Array ( Math . pow ( 2 , 17 ) / lorem . length + 1 ) . join ( lorem ) ) // Math.pow(2, 17) chars long
274
272
var sizes = [ 4 , Math . pow ( 2 , 17 ) ]
275
273
function checkReply ( reply ) {
276
- assert . strictEqual ( sizes [ replyCount ] , reply . length )
274
+ assert . strictEqual ( reply . length , sizes [ replyCount ] )
277
275
replyCount ++
278
276
}
279
277
var parser = newParser ( checkReply )
@@ -690,14 +688,14 @@ describe('parsers', function () {
690
688
assert . strictEqual ( replyCount , 3 )
691
689
parser . execute ( new Buffer ( '\r\n' ) )
692
690
assert . strictEqual ( replyCount , 4 )
693
- } , 25 )
691
+ } , 20 )
694
692
// Delay done so the bufferPool is cleared and tested
695
693
// If the buffer is not cleared, the coverage is not going to be at 100
696
694
setTimeout ( function ( ) {
697
695
var totalBuffer = Buffer . concat ( chunks ) . toString ( )
698
696
assert . strictEqual ( replies [ 3 ] . toString ( ) , totalBuffer )
699
697
done ( )
700
- } , ( jsParser ? 1400 : 50 ) )
698
+ } , ( jsParser ? 1400 : 40 ) )
701
699
} )
702
700
703
701
it ( 'handle big data' , function ( ) {
@@ -714,7 +712,7 @@ describe('parsers', function () {
714
712
715
713
it ( 'handle big data 2 with buffers' , function ( done ) {
716
714
this . timeout ( 7500 )
717
- var size = 120 * 1024 * 1024
715
+ var size = 111.5 * 1024 * 1024
718
716
var replyLen = [ size , size * 2 , 11 , 11 ]
719
717
function checkReply ( reply ) {
720
718
assert . strictEqual ( reply . length , replyLen [ replyCount ] )
@@ -732,7 +730,7 @@ describe('parsers', function () {
732
730
parser . execute ( new Buffer ( ' buffer\r\n' ) )
733
731
assert . strictEqual ( replyCount , 4 )
734
732
done ( )
735
- } , 75 )
733
+ } , 60 )
736
734
} )
737
735
} )
738
736
} )
0 commit comments