@@ -2261,6 +2261,25 @@ tests.unref = function () {
2261
2261
}, 500);
2262
2262
};*/
2263
2263
2264
+ tests . CONSTRUCTOR_ARGUMENTS = function ( ) {
2265
+ var name = "constructor arguments" ;
2266
+ var client1 = redis . createClient ( { host : "testdomain.com" , port : 1790 } ) ;
2267
+ var client2 = redis . createClient ( { url : "redis://testdomain.com:1791" } ) ;
2268
+ var client3 = redis . createClient ( { path : "testdomain.com:1792" } ) ;
2269
+ var client4 = redis . createClient ( { path : "testdomain.com:1793" , return_buffers : true } ) ;
2270
+ assert . equal ( "object" , typeof redis . backends [ "testdomain.com:1790" ] , name + " host & port" ) ;
2271
+ assert . equal ( "object" , typeof redis . backends [ "redis://testdomain.com:1791" ] , name + " url" ) ;
2272
+ assert . equal ( "object" , typeof redis . backends [ "testdomain.com:1792" ] , name + " path" ) ;
2273
+ client4 . set ( "string key 1" , "string value" ) ;
2274
+ client4 . get ( "string key 1" , require_string ( "string value" , name ) ) ;
2275
+ client4 . get ( new Buffer ( "string key 1" ) , function ( err , reply ) {
2276
+ assert . strictEqual ( null , err , name ) ;
2277
+ assert . strictEqual ( true , Buffer . isBuffer ( reply ) , name ) ;
2278
+ assert . strictEqual ( "<Buffer 73 74 72 69 6e 67 20 76 61 6c 75 65>" , reply . inspect ( ) , name ) ;
2279
+ } ) ;
2280
+ next ( name ) ;
2281
+ } ;
2282
+
2264
2283
all_tests = Object . keys ( tests ) ;
2265
2284
all_start = new Date ( ) ;
2266
2285
test_count = 0 ;
0 commit comments