@@ -127,8 +127,8 @@ public async Task ConnectWithBrokenHello(string command, bool isResp3)
127127 [ InlineData ( "return 'abc'" , RedisProtocol . Resp2 , ResultType . BulkString , ResultType . BulkString , "abc" ) ]
128128 [ InlineData ( @"return {1,2,3}" , RedisProtocol . Resp2 , ResultType . Array , ResultType . Array , ARR_123 ) ]
129129 [ InlineData ( "return nil" , RedisProtocol . Resp2 , ResultType . BulkString , ResultType . Null , null ) ]
130- [ InlineData ( @"return redis.pcall('hgetall', 'key')" , RedisProtocol . Resp2 , ResultType . Array , ResultType . Array , MAP_ABC ) ]
131- [ InlineData ( @"redis.setresp(3) return redis.pcall('hgetall', 'key')" , RedisProtocol . Resp2 , ResultType . Array , ResultType . Array , MAP_ABC ) ]
130+ [ InlineData ( @"return redis.pcall('hgetall', '{ key} ')" , RedisProtocol . Resp2 , ResultType . Array , ResultType . Array , MAP_ABC ) ]
131+ [ InlineData ( @"redis.setresp(3) return redis.pcall('hgetall', '{ key} ')" , RedisProtocol . Resp2 , ResultType . Array , ResultType . Array , MAP_ABC ) ]
132132 [ InlineData ( "return true" , RedisProtocol . Resp2 , ResultType . Integer , ResultType . Integer , 1 ) ]
133133 [ InlineData ( "return false" , RedisProtocol . Resp2 , ResultType . BulkString , ResultType . Null , null ) ]
134134 [ InlineData ( "redis.setresp(3) return true" , RedisProtocol . Resp2 , ResultType . Integer , ResultType . Integer , 1 ) ]
@@ -142,8 +142,8 @@ public async Task ConnectWithBrokenHello(string command, bool isResp3)
142142 [ InlineData ( "return 'abc'" , RedisProtocol . Resp3 , ResultType . BulkString , ResultType . BulkString , "abc" ) ]
143143 [ InlineData ( "return {1,2,3}" , RedisProtocol . Resp3 , ResultType . Array , ResultType . Array , ARR_123 ) ]
144144 [ InlineData ( "return nil" , RedisProtocol . Resp3 , ResultType . BulkString , ResultType . Null , null ) ]
145- [ InlineData ( @"return redis.pcall('hgetall', 'key')" , RedisProtocol . Resp3 , ResultType . Array , ResultType . Array , MAP_ABC ) ]
146- [ InlineData ( @"redis.setresp(3) return redis.pcall('hgetall', 'key')" , RedisProtocol . Resp3 , ResultType . Array , ResultType . Map , MAP_ABC ) ]
145+ [ InlineData ( @"return redis.pcall('hgetall', '{ key} ')" , RedisProtocol . Resp3 , ResultType . Array , ResultType . Array , MAP_ABC ) ]
146+ [ InlineData ( @"redis.setresp(3) return redis.pcall('hgetall', '{ key} ')" , RedisProtocol . Resp3 , ResultType . Array , ResultType . Map , MAP_ABC ) ]
147147 [ InlineData ( "return true" , RedisProtocol . Resp3 , ResultType . Integer , ResultType . Integer , 1 ) ]
148148 [ InlineData ( "return false" , RedisProtocol . Resp3 , ResultType . BulkString , ResultType . Null , null ) ]
149149 [ InlineData ( "redis.setresp(3) return true" , RedisProtocol . Resp3 , ResultType . Integer , ResultType . Boolean , true ) ]
@@ -167,14 +167,16 @@ public async Task CheckLuaResult(string script, RedisProtocol protocol, ResultTy
167167 }
168168 if ( ep . Protocol is null ) throw new InvalidOperationException ( $ "No protocol! { ep . InteractiveConnectionState } ") ;
169169 Assert . Equal ( protocol , ep . Protocol ) ;
170+ var key = Me ( ) ;
171+ script = script . Replace ( "{key}" , key ) ;
170172
171173 var db = muxer . GetDatabase ( ) ;
172174 if ( expected is MAP_ABC )
173175 {
174- db . KeyDelete ( " key" ) ;
175- db . HashSet ( " key" , "a" , 1 ) ;
176- db . HashSet ( " key" , "b" , 2 ) ;
177- db . HashSet ( " key" , "c" , 3 ) ;
176+ db . KeyDelete ( key ) ;
177+ db . HashSet ( key , "a" , 1 ) ;
178+ db . HashSet ( key , "b" , 2 ) ;
179+ db . HashSet ( key , "c" , 3 ) ;
178180 }
179181 var result = await db . ScriptEvaluateAsync ( script : script , flags : CommandFlags . NoScriptCache ) ;
180182 Assert . Equal ( resp2 , result . Resp2Type ) ;
0 commit comments