Import Tcl 8.6.11
This commit is contained in:
@@ -9,8 +9,8 @@
|
||||
# See the file "license.terms" for information on usage and redistribution
|
||||
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
|
||||
if {[lsearch [namespace children] ::tcltest] == -1} {
|
||||
package require tcltest 2
|
||||
if {"::tcltest" ni [namespace children]} {
|
||||
package require tcltest 2.5
|
||||
namespace import -force ::tcltest::*
|
||||
}
|
||||
|
||||
@@ -96,10 +96,10 @@ test unixFCmd-1.1 {TclpRenameFile: EACCES} -setup {
|
||||
cleanup
|
||||
} -constraints {unix notRoot} -body {
|
||||
file mkdir td1/td2/td3
|
||||
file attributes td1/td2 -permissions 0000
|
||||
file attributes td1/td2 -permissions 0o000
|
||||
file rename td1/td2/td3 td2
|
||||
} -returnCodes error -cleanup {
|
||||
file attributes td1/td2 -permissions 0755
|
||||
file attributes td1/td2 -permissions 0o755
|
||||
cleanup
|
||||
} -result {error renaming "td1/td2/td3": permission denied}
|
||||
test unixFCmd-1.2 {TclpRenameFile: EEXIST} -setup {
|
||||
@@ -137,11 +137,11 @@ test unixFCmd-1.7 {TclpRenameFile: EXDEV} -setup {
|
||||
cleanup
|
||||
} -constraints {unix notRoot} -body {
|
||||
file mkdir foo/bar
|
||||
file attr foo -perm 040555
|
||||
file attr foo -perm 0o40555
|
||||
file rename foo/bar /tmp
|
||||
} -returnCodes error -cleanup {
|
||||
catch {file delete /tmp/bar}
|
||||
catch {file attr foo -perm 040777}
|
||||
catch {file attr foo -perm 0o40777}
|
||||
catch {file delete -force foo}
|
||||
} -match glob -result {*: permission denied}
|
||||
test unixFCmd-1.8 {Checking EINTR Bug} {unix notRoot nonPortable} {
|
||||
@@ -221,12 +221,12 @@ test unixFCmd-2.5 {TclpCopyFile: copy attributes} -setup {
|
||||
cleanup
|
||||
} -constraints {unix notRoot} -body {
|
||||
close [open tf1 a]
|
||||
file attributes tf1 -permissions 0472
|
||||
file attributes tf1 -permissions 0o472
|
||||
file copy tf1 tf2
|
||||
file attributes tf2 -permissions
|
||||
format 0o%03o [file attributes tf2 -permissions]
|
||||
} -cleanup {
|
||||
cleanup
|
||||
} -result 00472 ;# i.e. perms field of [exec ls -l tf2] is -r--rwx-w-
|
||||
} -result 0o472 ;# i.e. perms field of [exec ls -l tf2] is -r--rwx-w-
|
||||
|
||||
test unixFCmd-3.1 {CopyFile not done} {emptyTest unix notRoot} {
|
||||
} {}
|
||||
@@ -336,15 +336,15 @@ test unixFCmd-17.1 {SetPermissionsAttribute} -setup {
|
||||
catch {file delete -force -- foo.test}
|
||||
} -constraints {unix notRoot} -body {
|
||||
close [open foo.test w]
|
||||
list [file attributes foo.test -permissions 0000] \
|
||||
[file attributes foo.test -permissions]
|
||||
list [file attributes foo.test -permissions 0o000] \
|
||||
[format 0o%03o [file attributes foo.test -permissions]]
|
||||
} -cleanup {
|
||||
file delete -force -- foo.test
|
||||
} -result {{} 00000}
|
||||
} -result {{} 0o000}
|
||||
test unixFCmd-17.2 {SetPermissionsAttribute} -setup {
|
||||
catch {file delete -force -- foo.test}
|
||||
} -constraints {unix notRoot} -returnCodes error -body {
|
||||
file attributes foo.test -permissions 0000
|
||||
file attributes foo.test -permissions 0o000
|
||||
} -result {could not set permissions for file "foo.test": no such file or directory}
|
||||
test unixFCmd-17.3 {SetPermissionsAttribute} -setup {
|
||||
catch {file delete -force -- foo.test}
|
||||
@@ -370,16 +370,16 @@ proc permcheck {testnum permList expected} {
|
||||
set result {}
|
||||
foreach permstr $permList {
|
||||
file attributes foo.test -permissions $permstr
|
||||
lappend result [file attributes foo.test -permissions]
|
||||
lappend result [format 0o%03o [file attributes foo.test -permissions]]
|
||||
}
|
||||
set result
|
||||
} $expected
|
||||
}
|
||||
permcheck unixFCmd-17.5 rwxrwxrwx 00777
|
||||
permcheck unixFCmd-17.6 r--r---w- 00442
|
||||
permcheck unixFCmd-17.7 {0 u+rwx,g+r u-w o+rwx} {00000 00740 00540 00547}
|
||||
permcheck unixFCmd-17.11 --x--x--x 00111
|
||||
permcheck unixFCmd-17.12 {0 a+rwx} {00000 00777}
|
||||
permcheck unixFCmd-17.5 rwxrwxrwx 0o777
|
||||
permcheck unixFCmd-17.6 r--r---w- 0o442
|
||||
permcheck unixFCmd-17.7 {0 u+rwx,g+r u-w o+rwx} {0o000 0o740 0o540 0o547}
|
||||
permcheck unixFCmd-17.11 --x--x--x 0o111
|
||||
permcheck unixFCmd-17.12 {0 a+rwx} {0o000 0o777}
|
||||
file delete -force -- foo.test
|
||||
|
||||
test unixFCmd-18.1 {Unix pwd} -constraints {unix notRoot nonPortable} -setup {
|
||||
@@ -390,11 +390,11 @@ test unixFCmd-18.1 {Unix pwd} -constraints {unix notRoot nonPortable} -setup {
|
||||
set nd $cd/tstdir
|
||||
file mkdir $nd
|
||||
cd $nd
|
||||
file attributes $nd -permissions 0000
|
||||
file attributes $nd -permissions 0o000
|
||||
pwd
|
||||
} -returnCodes error -cleanup {
|
||||
cd $cd
|
||||
file attributes $nd -permissions 0755
|
||||
file attributes $nd -permissions 0o755
|
||||
file delete $nd
|
||||
} -match glob -result {error getting working directory name:*}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user