diff options
author | sebres <sebres@users.sourceforge.net> | 2019-09-11 11:51:48 (GMT) |
---|---|---|
committer | sebres <sebres@users.sourceforge.net> | 2019-09-11 11:51:48 (GMT) |
commit | 2e2c130d222a25481ee59b526f5bcfb7f2e47d7a (patch) | |
tree | fe12a44e3644161867f9ac11f73050dba2c72602 /tests/cmdAH.test | |
parent | b293fd6b50a40155a894a1ef1afc9e8375d2dcc8 (diff) | |
parent | 56f6e73e6f3bb4c7cf408f25e72f4818914dada3 (diff) | |
download | tcl-2e2c130d222a25481ee59b526f5bcfb7f2e47d7a.zip tcl-2e2c130d222a25481ee59b526f5bcfb7f2e47d7a.tar.gz tcl-2e2c130d222a25481ee59b526f5bcfb7f2e47d7a.tar.bz2 |
merge 8.5 (bug [7de2d722bd])
Diffstat (limited to 'tests/cmdAH.test')
-rw-r--r-- | tests/cmdAH.test | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/tests/cmdAH.test b/tests/cmdAH.test index 3f7e449..b60f658 100644 --- a/tests/cmdAH.test +++ b/tests/cmdAH.test @@ -1315,8 +1315,28 @@ test cmdAH-24.20.2 {Tcl_FileObjCmd: mtime 64-bit time_t, bug [4718b41c56]} -cons test cmdAH-25.1 {Tcl_FileObjCmd: owned} -returnCodes error -body { file owned a b } -result {wrong # args: should be "file owned name"} -test cmdAH-25.2 {Tcl_FileObjCmd: owned} -constraints win -body { - file owned $gorpfile +test cmdAH-25.2 {Tcl_FileObjCmd: owned} -constraints win -setup { + set fn $gorpfile + # prefer temp file to check owner (try to avoid bug [7de2d722bd]): + if { + [info exists ::env(TEMP)] && [file isdirectory $::env(TEMP)] && + [file dirname $fn] ne [file normalize $::env(TEMP)] + } { + set fn [file join $::env(TEMP)/test-owner-from-tcl.txt] + set fn [makeFile "data" test-owner-from-tcl.txt $::env(TEMP)] + } + # be sure we have really owned this file before trying to check that + # (avoid dependency on admin with UAC and the setting "System objects: + # Default owner for objects created by members of the Administrators group"): + catch { + exec takeown /F [file nativename $fn] + } +} -body { + file owned $fn +} -cleanup { + if {$fn ne $gorpfile} { + removeFile $fn + } } -result 1 test cmdAH-25.2.1 {Tcl_FileObjCmd: owned} -constraints unix -setup { # Avoid problems with AFS |