From 7877ebe805f8eb5114cc3780cee591569b79d2d7 Mon Sep 17 00:00:00 2001 From: ericm Date: Wed, 8 Mar 2000 20:12:38 +0000 Subject: * tests/choosedir.test: Modified test 3.1 (-mustexist works) to be more careful about cleaning up its potentially troublesome after events. --- tests/choosedir.test | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/choosedir.test b/tests/choosedir.test index d527eb5..0ccf04c 100644 --- a/tests/choosedir.test +++ b/tests/choosedir.test @@ -5,7 +5,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: choosedir.test,v 1.5 2000/03/07 00:02:34 ericm Exp $ +# RCS: @(#) $Id: choosedir.test,v 1.6 2000/03/08 20:12:38 ericm Exp $ # if {[lsearch [namespace children] ::tcltest] == -1} { @@ -111,12 +111,15 @@ test choosedir-2.1 "tk_chooseDirectory command, cancel gives null" {unixOnly} { } "" test choosedir-3.1 "tk_chooseDirectory -mustexist 1" {unixOnly} { - ToEnterDirByKey $parent $fake - after 10 - ToEnterDirByKey $parent $real - tk_chooseDirectory \ + # first enter a bogus dirname, then enter a real one. + set afterId1 [after 100 EnterDirByKey $parent [list $fake]] + set afterId2 [after 200 EnterDirByKey $parent [list $real]] + set result [tk_chooseDirectory \ -title "Enter \"$fake\", press OK, enter \"$real\", press OK" \ - -parent $parent -mustexist 1 + -parent $parent -mustexist 1] + after cancel $afterId1 + after cancel $afterId2 + set result } $real test choosedir-3.2 "tk_chooseDirectory -mustexist 0" {unixOnly} { ToEnterDirByKey $parent $fake -- cgit v0.12