From 03770a2f62e8472b753078073b20ed5f20b889e9 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 25 Mar 2002 19:20:02 +0000 Subject: * Improve the processing of the -constraints option to [test] so that constraint lists can have arbitrary whitespace, and non-lists don't blow things up. [Bug 495977] --- ChangeLog | 3 +++ library/tcltest/tcltest.tcl | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 19a92d9..907eed0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,9 @@ unchanged, so that the tcltest package can test code that depends on auto-loading. If a testing application needs $::auto_path pruned, it should do that itself. [Bug 495726] + Improve the processing of the -constraints option to [test] so that + constraint lists can have arbitrary whitespace, and non-lists don't + blow things up. [Bug 495977] 2002-03-25 Miguel Sofer diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl index 1667bea..6cb60c3 100644 --- a/library/tcltest/tcltest.tcl +++ b/library/tcltest/tcltest.tcl @@ -13,7 +13,7 @@ # Copyright (c) 2000 by Ajuba Solutions # All rights reserved. # -# RCS: @(#) $Id: tcltest.tcl,v 1.38 2002/03/25 17:10:57 dgp Exp $ +# RCS: @(#) $Id: tcltest.tcl,v 1.39 2002/03/25 19:20:03 dgp Exp $ # create the "tcltest" namespace for all testing variables and procedures @@ -2479,13 +2479,13 @@ proc tcltest::runTest {name description script expectedAnswer constraints} { if {[string match {*[$\[]*} $constraints] != 0} { # full expression, e.g. {$foo > [info tclversion]} catch {set doTest [uplevel #0 expr $constraints]} - } elseif {[regexp {[^.a-zA-Z0-9 ]+} $constraints] != 0} { + } elseif {[regexp {[^.a-zA-Z0-9 \n\r\t]+} $constraints] != 0} { # something like {a || b} should be turned into # $tcltest::testConstraints(a) || $tcltest::testConstraints(b). regsub -all {[.\w]+} $constraints \ {$tcltest::testConstraints(&)} c catch {set doTest [eval expr $c]} - } else { + } elseif {![catch {llength $constraints}]} { # just simple constraints such as {unixOnly fonts}. set doTest 1 foreach constraint $constraints { -- cgit v0.12