File tree 1 file changed +11
-6
lines changed
1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -350,16 +350,21 @@ async fn test_getrange() {
350
350
#[ serial]
351
351
async fn test_keys ( ) {
352
352
test_compare :: < Vec < Value > > ( |p| {
353
- // Redis keys order is deterministice but not guaranteed.
354
- // We sort the keys by insertion order to make the test deterministic.
355
- // Testing with a different set of keys produces different results,
356
- // but matching the implementation is out of the scope of the project.
353
+ // Redis keys order is deterministic (always returning the same order for
354
+ // a given set of keys) but not guaranteed (it may change between runs).
355
+ //
356
+ // We sort in backward chronological order to get deterministic results.
357
+ // Matching the implementation is out of the scope of the project.
357
358
p. cmd ( "SET" ) . arg ( "keys_key_1" ) . arg ( "Argentina" ) ;
358
- p. cmd ( "SET" ) . arg ( "keys_key_2" ) . arg ( "Spain" ) ;
359
- p. cmd ( "SET" ) . arg ( "keys_key_3" ) . arg ( "Netherlands" ) ;
360
359
361
360
p. cmd ( "KEYS" ) . arg ( "*" ) ;
362
361
p. cmd ( "KEYS" ) . arg ( "*key*" ) ;
362
+
363
+ p. cmd ( "SET" ) . arg ( "keys_key_2" ) . arg ( "Spain" ) ;
364
+ p. cmd ( "SET" ) . arg ( "keys_key_3" ) . arg ( "Netherlands" ) ;
365
+
366
+ p. cmd ( "KEYS" ) . arg ( "*1" ) ;
367
+ p. cmd ( "KEYS" ) . arg ( "*2" ) ;
363
368
p. cmd ( "KEYS" ) . arg ( "*3" ) ;
364
369
} )
365
370
. await ;
You can’t perform that action at this time.
0 commit comments