@@ -60,6 +60,38 @@ test('executing query', function () {
60
60
} )
61
61
} )
62
62
63
+ test ( "multiple in the queue, pipelining mode" , function ( ) {
64
+ var client = helper . client ( )
65
+ client . pipelining = true
66
+ var connection = client . connection
67
+ var queries = connection . queries
68
+ client . query ( 'one' )
69
+ client . query ( 'two' )
70
+ client . query ( 'three' )
71
+ assert . empty ( queries )
72
+
73
+ test ( "after one ready for query" , function ( ) {
74
+ connection . emit ( 'readyForQuery' )
75
+ assert . lengthIs ( queries , 3 )
76
+ assert . equal ( queries [ 0 ] , "one" )
77
+ } )
78
+
79
+ test ( 'after two ready for query' , function ( ) {
80
+ connection . emit ( 'readyForQuery' )
81
+ assert . lengthIs ( queries , 3 )
82
+ } )
83
+
84
+ test ( "after a bunch more" , function ( ) {
85
+ connection . emit ( 'readyForQuery' )
86
+ connection . emit ( 'readyForQuery' )
87
+ connection . emit ( 'readyForQuery' )
88
+ assert . lengthIs ( queries , 3 )
89
+ assert . equal ( queries [ 0 ] , "one" )
90
+ assert . equal ( queries [ 1 ] , 'two' )
91
+ assert . equal ( queries [ 2 ] , 'three' )
92
+ } )
93
+ } )
94
+
63
95
test ( 'query event binding and flow' , function ( ) {
64
96
var client = helper . client ( )
65
97
var con = client . connection
0 commit comments