diff options
author | sebres <sebres@users.sourceforge.net> | 2018-04-30 11:36:31 (GMT) |
---|---|---|
committer | sebres <sebres@users.sourceforge.net> | 2018-04-30 11:36:31 (GMT) |
commit | 6ef77228ca33c92d22e830a0d5f86ef1b34e7398 (patch) | |
tree | 623e06925a7930718bab7ca5c59a7e33574081cd /tests | |
parent | c876decde3e6b34582d26e1cef4967b777a8753c (diff) | |
parent | ddfce0ed3f91a335d169f6f25cae2da7051d0631 (diff) | |
download | tcl-6ef77228ca33c92d22e830a0d5f86ef1b34e7398.zip tcl-6ef77228ca33c92d22e830a0d5f86ef1b34e7398.tar.gz tcl-6ef77228ca33c92d22e830a0d5f86ef1b34e7398.tar.bz2 |
merge core-8-5-branch (fix-1613456fff)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/fileName.test | 16 | ||||
-rw-r--r-- | tests/tcltest.test | 6 | ||||
-rw-r--r-- | tests/winFCmd.test | 8 |
3 files changed, 23 insertions, 7 deletions
diff --git a/tests/fileName.test b/tests/fileName.test index ce89623..7f983a7 100644 --- a/tests/fileName.test +++ b/tests/fileName.test @@ -778,6 +778,8 @@ test filename-11.16 {Tcl_GlobCmd} { } {globTest} set globname "globTest" set horribleglobname "glob\[\{Test" +set tildeglobname "./~test.txt" + test filename-11.17 {Tcl_GlobCmd} {unix} { lsort [glob -directory $globname *] } [lsort [list [file join $globname a1] [file join $globname a2]\ @@ -917,11 +919,12 @@ test filename-11.21.1 {Tcl_GlobCmd} -body { } -result {{[tcl].testremains}} # Get rid of file/dir if it exists, since it will have been left behind by a # previous failed run. -if {[file exists $horribleglobname]} { - file delete -force $horribleglobname -} +file delete -force $horribleglobname file rename globTest $horribleglobname set globname $horribleglobname +file delete -force $tildeglobname +close [open $tildeglobname w] + test filename-11.22 {Tcl_GlobCmd} {unix} { lsort [glob -dir $globname *] } [lsort [list [file join $globname a1] [file join $globname a2]\ @@ -1040,7 +1043,9 @@ test filename-11.41 {Tcl_GlobCmd} -body { test filename-11.42 {Tcl_GlobCmd} -body { set res [list] foreach f [glob -dir [pwd] *] { - lappend res [file tail $f] + set f [file tail $f] + regsub {^./} $f {} f; # until glob bug [2511011fff] don't fixed (tilde expansion prevention). + lappend res $f } list $res [glob *] } -match compareWords -result equal @@ -1080,8 +1085,9 @@ test filename-11.49 {Tcl_GlobCmd} -returnCodes error -body { } -result {bad argument to "-types": abcde} file rename $horribleglobname globTest +file delete -force $tildeglobname set globname globTest -unset horribleglobname +unset horribleglobname tildeglobname test filename-12.1 {simple globbing} {unixOrPc} { glob {} diff --git a/tests/tcltest.test b/tests/tcltest.test index 728a018..17fa926 100644 --- a/tests/tcltest.test +++ b/tests/tcltest.test @@ -550,6 +550,7 @@ switch -- $::tcl_platform(platform) { file attributes $notWriteableDir -permissions 00555 } default { + # note in FAT/NTFS we won't be able to protect directory with read-only attribute... catch {file attributes $notWriteableDir -readonly 1} catch {testchmod 0 $notWriteableDir} } @@ -566,9 +567,10 @@ test tcltest-8.3 {tcltest a.tcl -tmpdir notReadableDir} { # This constraint doesn't go at the top of the file so that it doesn't # interfere with tcltest-5.5 testConstraint notFAT [expr { - ![string match "FAT*" [lindex [file system $notWriteableDir] 1]] + ![regexp {^(FAT\d*|NTFS)$} [lindex [file system $notWriteableDir] 1]] + || $::tcl_platform(platform) eq "unix" || [llength [info commands testchmod]] }] -# FAT permissions are fairly hopeless; ignore this test if that FS is used +# FAT/NTFS permissions are fairly hopeless; ignore this test if that FS is used test tcltest-8.4 {tcltest a.tcl -tmpdir notWriteableDir} { -constraints {unixOrPc notRoot notFAT} -body { diff --git a/tests/winFCmd.test b/tests/winFCmd.test index a808c82..0e5ef38 100644 --- a/tests/winFCmd.test +++ b/tests/winFCmd.test @@ -1078,6 +1078,14 @@ test winFCmd-12.6 {ConvertFileNameFormat: absolute path with drive} -setup { } -cleanup { file delete -force -- c:/td1 } -result {c:/td1} +test winFCmd-12.6.2 {ConvertFileNameFormat: absolute path with drive (in temp folder)} -setup { + catch {file delete -force -- $::env(TEMP)/td1} +} -constraints {win} -body { + createfile $::env(TEMP)/td1 {} + string tolower [file attributes $::env(TEMP)/td1 -longname] +} -cleanup { + file delete -force -- $::env(TEMP)/td1 +} -result [string tolower [file normalize $::env(TEMP)]/td1] test winFCmd-12.7 {ConvertFileNameFormat} -body { string tolower [file attributes //bisque/tcl/ws -longname] } -constraints {nonPortable win} -result {//bisque/tcl/ws} |