aboutsummaryrefslogtreecommitdiff
path: root/tests/file.test
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2020-05-04 22:19:53 +1000
committerSteve Bennett <steveb@workware.net.au>2020-05-04 23:04:09 +1000
commit9366d8f76430fac4c64be6dd99e44a13ed4c2fb9 (patch)
treeea0af6f35b44e1b441c3b2de9f9cc286929cfb6c /tests/file.test
parentb58ccf39a730dba009abbbae19cb55e0200d37ac (diff)
downloadjimtcl-9366d8f76430fac4c64be6dd99e44a13ed4c2fb9.zip
jimtcl-9366d8f76430fac4c64be6dd99e44a13ed4c2fb9.tar.gz
jimtcl-9366d8f76430fac4c64be6dd99e44a13ed4c2fb9.tar.bz2
tests: Fixes to recent tests for windows
Mostly just avoiding running certain tests, but also: - rename() won't overwrite an existing file on Windows - ensure that eof returns 0 or 1 - in aio.test, create and read the file in binary mode Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tests/file.test')
-rw-r--r--tests/file.test9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/file.test b/tests/file.test
index 73eb481..f0a0d44 100644
--- a/tests/file.test
+++ b/tests/file.test
@@ -5,6 +5,7 @@ catch {file link} msg
testConstraint filelink [string match "wrong # args:*" $msg]
catch {file lstat} msg
testConstraint filelstat [string match "wrong # args:*" $msg]
+testConstraint unix [expr {$tcl_platform(platform) eq "unix"}]
test join-1.1 "One name" {
file join abc
@@ -360,10 +361,12 @@ test mtime-1.3 {file mtime} -body {
test mtime-1.4 {file mtime} {
set mtime [file mtime [info script]]
file stat [info script] s
- expr {$mtime - $s(mtime)}
-} {0}
+ if {$mtime != $s(mtime)} {
+ error "mtime was $mtime but s(mtime) was $s(mtime)"
+ }
+} {}
-test mtime-1.5 {file mtime} -body {
+test mtime-1.5 {file mtime} -constraints unix -body {
set name tmp.[pid]
makeFile testing $name
set t [file mtime [info script]]