diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/fileName.test | 14 | ||||
-rw-r--r-- | tests/winFCmd.test | 49 |
2 files changed, 54 insertions, 9 deletions
diff --git a/tests/fileName.test b/tests/fileName.test index 9c6cbb1..0cf0c1c 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.43 2004/06/23 15:36:56 dkf Exp $ +# RCS: @(#) $Id: fileName.test,v 1.44 2004/10/07 14:50:23 vincentdarley Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -1484,6 +1484,18 @@ test filename-16.15 {windows specific globbing} {win} { test filename-16.16 {windows specific globbing} {win} { file tail [lindex [glob -nocomplain "[lindex [glob -types d -dir C:/ *] 0]/.."] 0] } {..} +test filename-16.17 {windows specific globbing} {win} { + cd C:/ + # Ensure correct trimming of tails with absolute and + # volume relative globbing. + set res1 [glob -nocomplain -tails -dir C:/ *] + set res2 [glob -nocomplain -tails -dir C: *] + if {$res1 eq $res2} { + concat ok + } else { + concat $res1 ne $res2 + } +} {ok} test filename-17.1 {windows specific special files} {testsetplatform} { testsetplatform win 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 |