summaryrefslogtreecommitdiffstats
path: root/tests/fCmd.test
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2023-03-07 02:52:26 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2023-03-07 02:52:26 (GMT)
commit1f6cec5ff3943450001a29bea3371dea9f23db7f (patch)
tree1e0f72f362b61a1ec2d08040760a74d031204da5 /tests/fCmd.test
parentfe7ee5477246fbb3f9dd369e38722690353b72f2 (diff)
downloadtcl-1f6cec5ff3943450001a29bea3371dea9f23db7f.zip
tcl-1f6cec5ff3943450001a29bea3371dea9f23db7f.tar.gz
tcl-1f6cec5ff3943450001a29bea3371dea9f23db7f.tar.bz2
Fix testchmod and associated tests that always failed on Windows
Diffstat (limited to 'tests/fCmd.test')
-rw-r--r--tests/fCmd.test18
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/fCmd.test b/tests/fCmd.test
index dad1af9..ecb1d04 100644
--- a/tests/fCmd.test
+++ b/tests/fCmd.test
@@ -1065,6 +1065,7 @@ test fCmd-10.3.1 {file copy: comprehensive: dir to new name} -setup {
file mkdir [file join td1 tdx]
file mkdir [file join td2 tdy]
testchmod 0o555 td2
+ testchmod 0o555 td2/tdy; # Above line removes inherited perms. So restore.
file copy td1 td3
file copy td2 td4
list [lsort [glob td*]] [glob -directory td3 t*] \
@@ -1086,10 +1087,19 @@ test fCmd-10.4 {file copy: comprehensive: file to existing file} -setup {
createfile tfd2
createfile tfd3
createfile tfd4
- testchmod 0o444 tfs3
- testchmod 0o444 tfs4
- testchmod 0o444 tfd2
- testchmod 0o444 tfd4
+ if {$::tcl_platform(platform) eq "windows"} {
+ # On Windows testchmode will attach an ACL which file copy cannot handle
+ # so use good old attributes which file copy does understand
+ file attribute tfs3 -readonly 1
+ file attribute tfs4 -readonly 1
+ file attribute tfd2 -readonly 1
+ file attribute tfd4 -readonly 1
+ } else {
+ testchmod 0o444 tfs3
+ testchmod 0o444 tfs4
+ testchmod 0o444 tfd2
+ testchmod 0o444 tfd4
+ }
set msg [list [catch {file copy tf1 tf2} msg] $msg]
file copy -force tfs1 tfd1
file copy -force tfs2 tfd2