summaryrefslogtreecommitdiffstats
path: root/tests/chanio.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2017-04-14 09:05:01 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2017-04-14 09:05:01 (GMT)
commit73eb386816168576a6c42eea64be0b214e6d7d6c (patch)
tree632320ff8144756f72cf3850bede8c0170fc5c5c /tests/chanio.test
parentbc97ae8a02bb8363f85b25501b9aa125c5b344cd (diff)
downloadtcl-73eb386816168576a6c42eea64be0b214e6d7d6c.zip
tcl-73eb386816168576a6c42eea64be0b214e6d7d6c.tar.gz
tcl-73eb386816168576a6c42eea64be0b214e6d7d6c.tar.bz2
Don't use "0%o" format in test-cases, as it suggest's it's the normal way to format octal numbers: it isn't. Better use "%#o".
Add tests for "format" and "scan" corner-cases which weren't documented (except in TIP's) neither had tests before.
Diffstat (limited to 'tests/chanio.test')
-rw-r--r--tests/chanio.test8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/chanio.test b/tests/chanio.test
index 31bef36..cee2675 100644
--- a/tests/chanio.test
+++ b/tests/chanio.test
@@ -5338,22 +5338,22 @@ test chan-io-40.2 {POSIX open access modes: CREAT} -setup {
} -constraints {unix} -body {
set f [open $path(test3) {WRONLY CREAT} 0600]
file stat $path(test3) stats
- set x [format "0%o" [expr $stats(mode)&0o777]]
+ set x [format "%#o" [expr $stats(mode)&0o777]]
chan puts $f "line 1"
chan close $f
set f [open $path(test3) r]
lappend x [chan gets $f]
} -cleanup {
chan close $f
-} -result {0600 {line 1}}
+} -result {0o600 {line 1}}
test chan-io-40.3 {POSIX open access modes: CREAT} -setup {
file delete $path(test3)
} -constraints {unix umask} -body {
# This test only works if your umask is 2, like ouster's.
chan close [open $path(test3) {WRONLY CREAT}]
file stat $path(test3) stats
- format "0%o" [expr $stats(mode)&0o777]
-} -result [format %04o [expr {0o666 & ~ $umaskValue}]]
+ format "%#o" [expr $stats(mode)&0o777]
+} -result [format %#5o [expr {0o666 & ~ $umaskValue}]]
test chan-io-40.4 {POSIX open access modes: CREAT} -setup {
file delete $path(test3)
} -body {