From 1968b054ce6cb77985b7fabcad41ec530209fad5 Mon Sep 17 00:00:00 2001 From: Kevin B Kenny Date: Wed, 28 Oct 2009 16:46:33 +0000 Subject: * tests/fileName.test (fileName-20.[78]): Corrected poor test hygiene (failure to save and restore the working directory) that caused these two tests to fail on Windows (and [Bug 2806250] to be reopened). --- ChangeLog | 7 +++++++ tests/fileName.test | 13 ++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5d67ecd..cabe9f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-10-28 Kevin B. Kenny + + * tests/fileName.test (fileName-20.[78]): Corrected poor test + hygiene (failure to save and restore the working directory) that + caused these two tests to fail on Windows (and [Bug 2806250] + to be reopened). + 2009-10-27 Don Porter * generic/tclPathObj.c: Missing refcount on cached normalized path diff --git a/tests/fileName.test b/tests/fileName.test index a35cf86..c02cea3 100644 --- a/tests/fileName.test +++ b/tests/fileName.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: fileName.test,v 1.64 2009/08/21 18:32:08 dgp Exp $ +# RCS: @(#) $Id: fileName.test,v 1.65 2009/10/28 16:46:33 kennykb Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 @@ -1436,6 +1436,11 @@ test filename-16.17 {windows specific globbing} -constraints {win} -body { [glob -nocomplain -tails -dir C: *] } -match compareWords -result equal +# Put the working directory back now that we're done with globbing in C:/ +if {[testConstraint win]} { + cd $oldDir +} + test filename-17.1 {windows specific special files} {testsetplatform} { testsetplatform win list [file pathtype com1] [file pathtype con] [file pathtype lpt3] \ @@ -1543,6 +1548,8 @@ test fileName-20.6 {Bug 2837800} -setup { } -result {} test fileName-20.7 {Bug 2806250} -setup { + set savewd [pwd] + cd [temporaryDirectory] set d [makeDirectory isolate] makeFile {} ./~test $d } -body { @@ -1550,9 +1557,12 @@ test fileName-20.7 {Bug 2806250} -setup { } -cleanup { removeFile ./~test $d removeDirectory isolate + cd $savewd } -result 1 test fileName-20.8 {Bug 2806250} -setup { + set savewd [pwd] + cd [temporaryDirectory] set d [makeDirectory isolate] makeFile {} ./~test $d } -body { @@ -1560,6 +1570,7 @@ test fileName-20.8 {Bug 2806250} -setup { } -cleanup { removeFile ./~test $d removeDirectory isolate + cd $savewd } -result ./~test test fileName-20.9 {} -setup { -- cgit v0.12