summaryrefslogtreecommitdiffstats
path: root/tests/unixFCmd.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unixFCmd.test')
-rw-r--r--tests/unixFCmd.test26
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/unixFCmd.test b/tests/unixFCmd.test
index 8ac3ccc..09a34dd 100644
--- a/tests/unixFCmd.test
+++ b/tests/unixFCmd.test
@@ -4,7 +4,7 @@
# built-in commands. Sourcing this file into Tcl runs the tests and
# generates output for errors. No output means no errors were found.
#
-# Copyright (c) 1996 Sun Microsystems, Inc.
+# Copyright © 1996 Sun Microsystems, Inc.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -15,7 +15,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
-catch [list package require -exact Tcltest [info patchlevel]]
+catch [list package require -exact tcl::test [info patchlevel]]
testConstraint testchmod [llength [info commands testchmod]]
# File permissions broken on wsl without some "exotic" wsl configuration
@@ -98,7 +98,7 @@ test unixFCmd-1.1 {TclpRenameFile: EACCES} -setup {
cleanup
} -constraints {unix notRoot notWsl} -body {
file mkdir td1/td2/td3
- file attributes td1/td2 -permissions 0o000
+ file attributes td1/td2 -permissions 0
file rename td1/td2/td3 td2
} -returnCodes error -cleanup {
file attributes td1/td2 -permissions 0o755
@@ -112,7 +112,7 @@ test unixFCmd-1.2 {TclpRenameFile: EEXIST} -setup {
file rename td2 td1
} -returnCodes error -cleanup {
cleanup
-} -result {error renaming "td2" to "td1/td2": file already exists}
+} -result {error renaming "td2" to "td1/td2": file exists}
test unixFCmd-1.3 {TclpRenameFile: EINVAL} -setup {
cleanup
} -constraints {unix notRoot} -body {
@@ -225,7 +225,7 @@ test unixFCmd-2.5 {TclpCopyFile: copy attributes} -setup {
close [open tf1 a]
file attributes tf1 -permissions 0o472
file copy tf1 tf2
- format 0o%03o [file attributes tf2 -permissions]
+ file attributes tf2 -permissions
} -cleanup {
cleanup
} -result 0o472 ;# i.e. perms field of [exec ls -l tf2] is -r--rwx-w-
@@ -338,15 +338,15 @@ test unixFCmd-17.1 {SetPermissionsAttribute} -setup {
catch {file delete -force -- foo.test}
} -constraints {unix notRoot notWsl} -body {
close [open foo.test w]
- list [file attributes foo.test -permissions 0o000] \
- [format 0o%03o [file attributes foo.test -permissions]]
+ list [file attributes foo.test -permissions 0] \
+ [file attributes foo.test -permissions]
} -cleanup {
file delete -force -- foo.test
-} -result {{} 0o000}
+} -result {{} 00000}
test unixFCmd-17.2 {SetPermissionsAttribute} -setup {
catch {file delete -force -- foo.test}
} -constraints {unix notRoot} -returnCodes error -body {
- file attributes foo.test -permissions 0o000
+ file attributes foo.test -permissions 0
} -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}
@@ -372,16 +372,16 @@ proc permcheck {testnum permList expected} {
set result {}
foreach permstr $permList {
file attributes foo.test -permissions $permstr
- lappend result [format 0o%03o [file attributes foo.test -permissions]]
+ lappend result [file attributes foo.test -permissions]
}
set result
} $expected
}
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.7 {0 u+rwx,g+r u-w o+rwx} {00000 0o740 0o540 0o547}
permcheck unixFCmd-17.11 --x--x--x 0o111
-permcheck unixFCmd-17.12 {0 a+rwx} {0o000 0o777}
+permcheck unixFCmd-17.12 {0 a+rwx} {00000 0o777}
file delete -force -- foo.test
test unixFCmd-18.1 {Unix pwd} -constraints {unix notRoot nonPortable} -setup {
@@ -392,7 +392,7 @@ test unixFCmd-18.1 {Unix pwd} -constraints {unix notRoot nonPortable} -setup {
set nd $cd/tstdir
file mkdir $nd
cd $nd
- file attributes $nd -permissions 0o000
+ file attributes $nd -permissions 0
pwd
} -returnCodes error -cleanup {
cd $cd