From 86d392498ba41501f9508e03f6c830d7a5601631 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Thu, 29 Jul 2010 13:31:24 +0200 Subject: [PATCH] ensure the value is swapped in before testing its encoding --- tests/support/test.tcl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/support/test.tcl b/tests/support/test.tcl index 2c1fc164f..298e4c779 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:*" $dbg]} { + [r debug swapin $key] + set dbg [r debug object $key] + } + assert_match "* encoding:$enc *" $dbg } proc assert_type {type key} { -- GitLab