@@ -151,16 +151,17 @@ describe("The 'multi' method", function () {
151
151
var arr = [ "multihmset" , "multibar" , "multibaz" ] ;
152
152
var arr2 = [ 'some manner of key' , 'otherTypes' ] ;
153
153
var arr3 = [ 5768 , "multibarx" , "multifoox" ] ;
154
+ var arr4 = [ "mset" , [ 578 , "multibar" ] , helper . isString ( 'OK' ) ] ;
154
155
client . multi ( [
155
- [ "mset" , [ 578 , "multibar" ] , helper . isString ( 'OK' ) ] ,
156
+ arr4 ,
156
157
[ [ "mset" , "multifoo2" , "multibar2" , "multifoo3" , "multibar3" ] , helper . isString ( 'OK' ) ] ,
157
158
[ "hmset" , arr ] ,
158
159
[ [ "hmset" , "multihmset2" , "multibar2" , "multifoo3" , "multibar3" , "test" , helper . isString ( 'OK' ) ] ] ,
159
160
[ "hmset" , [ "multihmset" , "multibar" , "multifoo" , helper . isString ( 'OK' ) ] ] ,
160
161
[ "hmset" , arr3 , helper . isString ( 'OK' ) ] ,
161
162
[ 'hmset' , now , { 123456789 : "abcdefghij" , "some manner of key" : "a type of value" , "otherTypes" : 555 } ] ,
162
163
[ 'hmset' , 'key2' , { "0123456789" : "abcdefghij" , "some manner of key" : "a type of value" , "otherTypes" : 999 } , helper . isString ( 'OK' ) ] ,
163
- [ "hmset " , "multihmset" , [ "multibar" , "multibaz" ] ] ,
164
+ [ "HMSET " , "multihmset" , [ "multibar" , "multibaz" ] ] ,
164
165
[ "hmset" , "multihmset" , [ "multibar" , "multibaz" ] , helper . isString ( 'OK' ) ] ,
165
166
] )
166
167
. hmget ( now , 123456789 , 'otherTypes' )
@@ -174,6 +175,7 @@ describe("The 'multi' method", function () {
174
175
assert . equal ( arr . length , 3 ) ;
175
176
assert . equal ( arr2 . length , 2 ) ;
176
177
assert . equal ( arr3 . length , 3 ) ;
178
+ assert . equal ( arr4 . length , 3 ) ;
177
179
assert . strictEqual ( null , err ) ;
178
180
assert . equal ( replies [ 10 ] [ 1 ] , '555' ) ;
179
181
assert . equal ( replies [ 11 ] [ 0 ] , 'a type of value' ) ;
@@ -186,6 +188,14 @@ describe("The 'multi' method", function () {
186
188
} ) ;
187
189
} ) ;
188
190
191
+ it ( 'converts a non string key to a string' , function ( done ) {
192
+ // TODO: Converting the key might change soon again.
193
+ client . multi ( ) . hmset ( true , {
194
+ test : 123 ,
195
+ bar : 'baz'
196
+ } ) . exec ( done ) ;
197
+ } ) ;
198
+
189
199
it ( 'allows multiple operations to be performed using a chaining API' , function ( done ) {
190
200
client . multi ( )
191
201
. mset ( 'some' , '10' , 'keys' , '20' )
0 commit comments