diff options
author | fvogel <fvogelnew1@free.fr> | 2023-05-28 10:39:40 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2023-05-28 10:39:40 (GMT) |
commit | 69ae2a0f039e827976e6af9b7b2047473fa9f647 (patch) | |
tree | 6ca42482ca225aff4805a0de444f885b7f361dc1 /tests/ioCmd.test | |
parent | 0657f97bc5e5f5b835c2c60713f306fb97950a89 (diff) | |
parent | 7988b3f1b6d6acf879c174eeb322700ea5a1e325 (diff) | |
download | tcl-69ae2a0f039e827976e6af9b7b2047473fa9f647.zip tcl-69ae2a0f039e827976e6af9b7b2047473fa9f647.tar.gz tcl-69ae2a0f039e827976e6af9b7b2047473fa9f647.tar.bz2 |
merge 8.7
Diffstat (limited to 'tests/ioCmd.test')
-rw-r--r-- | tests/ioCmd.test | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/tests/ioCmd.test b/tests/ioCmd.test index 471659a..e603731 100644 --- a/tests/ioCmd.test +++ b/tests/ioCmd.test @@ -229,7 +229,7 @@ test iocmd-8.4 {fconfigure command} -setup { fconfigure $f1 froboz } -returnCodes error -cleanup { close $f1 -} -result [expectedOpts "froboz" {}] +} -result [expectedOpts "froboz" -stat] test iocmd-8.5 {fconfigure command} -returnCodes error -body { fconfigure stdin -buffering froboz } -result {bad value for -buffering: must be one of full, line, or none} @@ -592,7 +592,28 @@ test ioCmd-13.11 {open ... a+ must not use O_APPEND: Bug 1773127} -setup { } -cleanup { removeFile $f } -result 341234x6 - +test ioCmd-13.12 {open file produces something that has fconfigure -stat} -setup { + set f [makeFile {} iocmd13_12] + set result {} +} -body { + set fd [open $f wb] + set result [dict get [fconfigure $fd -stat] type] + fconfigure $fd -buffering none + puts -nonewline $fd abc + # Three ways of getting the size; all should agree! + lappend result [tell $fd] [file size $f] \ + [dict get [fconfigure $fd -stat] size] + puts -nonewline $fd def + lappend result [tell $fd] [file size $f] \ + [dict get [fconfigure $fd -stat] size] + puts -nonewline $fd ghi + lappend result [tell $fd] [file size $f] \ + [dict get [fconfigure $fd -stat] size] + close $fd + return $result +} -cleanup { + removeFile $f +} -result {file 3 3 3 6 6 6 9 9 9} test iocmd-14.1 {file id parsing errors} { list [catch {eof gorp} msg] $msg $::errorCode |