X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/c2ff0e90b8ce84d7b966622ffe0178303bb0a625..68254919284ec958225e1bc5fb2951ef096c92d1:/tests/support/test.tcl diff --git a/tests/support/test.tcl b/tests/support/test.tcl index 2c1fc164..93f64928 100644 --- a/tests/support/test.tcl +++ b/tests/support/test.tcl @@ -33,9 +33,14 @@ proc assert_error {pattern code} { } proc assert_encoding {enc key} { - # swapped out value doesn't have encoding, so swap in first - r debug swapin $key - assert_match "* encoding:$enc *" [r debug object $key] + # Swapped out values don't have an encoding, so make sure that + # the value is swapped in before checking the encoding. + set dbg [r debug object $key] + while {[string match "* swapped at:*" $dbg]} { + r debug swapin $key + set dbg [r debug object $key] + } + assert_match "* encoding:$enc *" $dbg } proc assert_type {type key} {