summaryrefslogtreecommitdiffstats
path: root/tests/winFCmd.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/winFCmd.test')
-rw-r--r--tests/winFCmd.test49
1 files changed, 41 insertions, 8 deletions
diff --git a/tests/winFCmd.test b/tests/winFCmd.test
index 891925e..9992db4 100644
--- a/tests/winFCmd.test
+++ b/tests/winFCmd.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: winFCmd.test,v 1.34 2004/09/27 15:00:42 vincentdarley Exp $
+# RCS: @(#) $Id: winFCmd.test,v 1.35 2004/10/07 14:50:23 vincentdarley Exp $
#
if {[lsearch [namespace children] ::tcltest] == -1} {
@@ -1023,17 +1023,34 @@ test winFCmd-16.11 {Windows file normalization} -constraints {win cdrom} \
# Must not crash
set result "no crash"
} -cleanup {
- cd ${d}:
+ cd $pwd
} -result {no crash}
-test winFCmd-16.12 {Windows file normalization} -constraints win -setup {
- set oldwd [pwd]
+
+test winFCmd-16.12 {Windows file normalization - no crash} \
+ -constraints win -setup {
set oldhome ""
catch {set oldhome $::env(HOME)}
} -body {
set expectedResult [file normalize ${d}:]
set ::env(HOME) ${d}:
cd
+ # At one point this led to an infinite recursion in Tcl
set result [pwd]; # <- Must not crash
+ set result "no crash"
+} -cleanup {
+ set ::env(HOME) $oldhome
+ cd $pwd
+} -result {no crash}
+
+test winFCmd-16.13 {Windows file normalization} -constraints win -setup {
+ set oldhome ""
+ catch {set oldhome $::env(HOME)}
+} -body {
+ # Test 'cd' normalization when HOME is absolute
+ set expectedResult [file normalize ${d}:/]
+ set ::env(HOME) ${d}:/
+ cd
+ set result [pwd]
if { [string equal $result $expectedResult] } {
concat ok
} else {
@@ -1041,12 +1058,28 @@ test winFCmd-16.12 {Windows file normalization} -constraints win -setup {
}
} -cleanup {
set ::env(HOME) $oldhome
- cd $oldwd
+ cd $pwd
} -result ok
-test winFCmd-16.13 {Windows bad permissions cd} -constraints win -setup {
- set oldwd [pwd]
+test winFCmd-16.14 {Windows file normalization} -constraints win -setup {
+ set oldhome ""
+ catch {set oldhome $::env(HOME)}
} -body {
+ # Test 'cd' normalization when HOME is relative
+ set ::env(HOME) ${d}:
+ cd
+ set result [pwd]
+ if { [string equal $result $pwd] } {
+ concat ok
+ } else {
+ list $result != $pwd
+ }
+} -cleanup {
+ set ::env(HOME) $oldhome
+ cd $pwd
+} -result ok
+
+test winFCmd-17.1 {Windows bad permissions cd} -constraints win -body {
set d {}
foreach dd {c:/ d:/ e:/} {
eval lappend d [glob -nocomplain \
@@ -1061,7 +1094,7 @@ test winFCmd-16.13 {Windows bad permissions cd} -constraints win -setup {
set err "permission denied"
}
} -cleanup {
- cd $oldwd
+ cd $pwd
} -result "permission denied"
cd $pwd