File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -771,6 +771,32 @@ tests.KEYS = function () {
771
771
} ) ;
772
772
} ;
773
773
774
+ tests . MULTIBULK = function ( ) {
775
+ var name = "MULTIBULK" ,
776
+ keys_values = [ ] ;
777
+
778
+ for ( var i = 0 ; i < 200 ; i ++ ) {
779
+ var key_value = [
780
+ "multibulk:" + crypto . randomBytes ( 256 ) . toString ( "hex" ) , // use long strings as keys to ensure generation of large packet
781
+ "test val " + i
782
+ ] ;
783
+ keys_values . push ( key_value ) ;
784
+ }
785
+
786
+ client . mset ( keys_values . reduce ( function ( a , b ) {
787
+ return a . concat ( b ) ;
788
+ } ) , require_string ( "OK" , name ) ) ;
789
+
790
+ client . KEYS ( "multibulk:*" , function ( err , results ) {
791
+ assert . strictEqual ( null , err , "result sent back unexpected error: " + err ) ;
792
+ assert . deepEqual ( keys_values . map ( function ( val ) {
793
+ return val [ 0 ] ;
794
+ } ) . sort ( ) , results . sort ( ) , name ) ;
795
+ } ) ;
796
+
797
+ next ( name ) ;
798
+ } ;
799
+
774
800
tests . MULTIBULK_ZERO_LENGTH = function ( ) {
775
801
var name = "MULTIBULK_ZERO_LENGTH" ;
776
802
client . KEYS ( [ 'users:*' ] , function ( err , results ) {
You can’t perform that action at this time.
0 commit comments