@@ -113,24 +113,34 @@ fn test_command_name() -> Result<()> {
113113
114114#[ test]
115115fn test_helper_info ( ) -> Result < ( ) > {
116- const MODULES : [ & str ; 2 ] = [ "test_helper" , "info_handler_macro" ] ;
117-
118- MODULES . iter ( ) . try_for_each ( |module| {
119- let port: u16 = 6483 ;
120- let _guards = vec ! [ start_redis_server_with_module( module, port)
121- . with_context( || "failed to start redis server" ) ?] ;
122- let mut con =
123- get_redis_connection ( port) . with_context ( || "failed to connect to redis server" ) ?;
124-
125- let res: String = redis:: cmd ( "INFO" )
126- . arg ( module)
127- . query ( & mut con)
128- . with_context ( || format ! ( "failed to run INFO {module}" ) ) ?;
129- assert ! ( res. contains( & format!( "{module}_field:test_helper_value" ) ) ) ;
130- assert ! ( res. contains( "dictionary:key=value" ) ) ;
131-
132- Ok ( ( ) )
133- } )
116+ const MODULES : [ ( & str , bool ) ; 4 ] = [
117+ ( "test_helper" , false ) ,
118+ ( "info_handler_macro" , false ) ,
119+ ( "info_handler_builder" , true ) ,
120+ ( "info_handler_struct" , true ) ,
121+ ] ;
122+
123+ MODULES
124+ . into_iter ( )
125+ . try_for_each ( |( module, has_dictionary) | {
126+ let port: u16 = 6483 ;
127+ let _guards = vec ! [ start_redis_server_with_module( module, port)
128+ . with_context( || "failed to start redis server" ) ?] ;
129+ let mut con =
130+ get_redis_connection ( port) . with_context ( || "failed to connect to redis server" ) ?;
131+
132+ let res: String = redis:: cmd ( "INFO" )
133+ . arg ( module)
134+ . query ( & mut con)
135+ . with_context ( || format ! ( "failed to run INFO {module}" ) ) ?;
136+ println ! ( "Now processing {module}. Result: {res}." ) ;
137+ assert ! ( res. contains( & format!( "{module}_field:value" ) ) ) ;
138+ if has_dictionary {
139+ assert ! ( res. contains( "dictionary:key=value" ) ) ;
140+ }
141+
142+ Ok ( ( ) )
143+ } )
134144}
135145
136146#[ allow( unused_must_use) ]
0 commit comments