aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2021-07-15 14:15:08 +1000
committerSteve Bennett <steveb@workware.net.au>2022-04-14 11:18:01 +1000
commit81e1890c0f595c474cabcaa83f66882005336d93 (patch)
tree75e9fe03c05b9780c1a34039e508121bb6cfced6 /tests
parent703ac20adb9daff423eea44f4af548f485a97254 (diff)
downloadjimtcl-81e1890c0f595c474cabcaa83f66882005336d93.zip
jimtcl-81e1890c0f595c474cabcaa83f66882005336d93.tar.gz
jimtcl-81e1890c0f595c474cabcaa83f66882005336d93.tar.bz2
aio: TIP 603 - Implement stat of an open file handle
Although the interface is different ('$handle stat' vs 'chan configure -stat') the behaviour is the same. Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tests')
-rw-r--r--tests/file.test18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/file.test b/tests/file.test
index 2347e5b..cf54c05 100644
--- a/tests/file.test
+++ b/tests/file.test
@@ -8,8 +8,10 @@ testConstraint filelstat [string match "wrong # args:*" $msg]
testConstraint unix [expr {$tcl_platform(platform) eq "unix"}]
if {[testConstraint jim]} {
testConstraint mtimeset [expr {!$tcl_platform(bootstrap)}]
+ testConstraint aiostat [expr {!$tcl_platform(bootstrap)}]
} else {
testConstraint mtimeset 1
+ testConstraint aiostat 0
}
test join-1.1 "One name" {
@@ -171,6 +173,22 @@ test stat-1.7 {file stat no variable} jim {
set a(type)
} {file}
+test aio-stat-1.1 {file stat via an open file descriptor} {jim aiostat} {
+ set filename [info script]
+ set fstat [file stat $filename]
+ set f [open $filename]
+ set aiostat [$f stat]
+ $f close
+ set ok 1
+ foreach field {size type mode mtime} {
+ if {$fstat($field) != $aiostat($field)} {
+ puts "error: $field: file stat:$fstat($field) != aio stat:$aiostat($field)"
+ set ok 0
+ }
+ }
+ set ok
+} {1}
+
test ext-1.1 {file ext} -body {
file ext
} -returnCodes error -result {wrong # args: should be "file extension name"}