summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2023-09-25 15:35:11 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2023-09-25 15:35:11 (GMT)
commit6e58f120f7aa56ccebaa00c7a97b409625700e98 (patch)
treea7222e92cf74a983da7592ab05ef9ffd7fd2b16e
parent80ff7a9129aa9b92b8d75418fbfee6521790a928 (diff)
parentea11b48037fc6e1e390196ddeba50a7e33991f57 (diff)
downloadtcl-6e58f120f7aa56ccebaa00c7a97b409625700e98.zip
tcl-6e58f120f7aa56ccebaa00c7a97b409625700e98.tar.gz
tcl-6e58f120f7aa56ccebaa00c7a97b409625700e98.tar.bz2
Merge 8.7 - zipfs file attribute tests
-rw-r--r--tests/zipfs.test21
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/zipfs.test b/tests/zipfs.test
index 4dbacc6..1073141 100644
--- a/tests/zipfs.test
+++ b/tests/zipfs.test
@@ -1317,7 +1317,26 @@ namespace eval test_ns_zipfs {
testzipfsglob mountpoint $defaultMountPoint [file join [zipfs root] *] \
[list $defaultMountPoint] {} -constraints !zipfslib
- # TODO tests for compress and save, + with password
+ #
+ # file attributes
+ proc testzipfsfileattr [list id path result [list mountpoint $defaultMountPoint] args] {
+ test zipfs-file-attrs-$id "zipfs file attrs $id" -setup {
+ mount [zippath test.zip] $mountpoint
+ } -cleanup cleanup -body {
+ lsort -stride 2 [file attributes $path]
+ } -result $result {*}$args
+ }
+ testzipfsfileattr noent [file join $defaultMountPoint nosuchfile] \
+ {file not found: no such file or directory} $defaultMountPoint -returnCodes error
+ testzipfsfileattr file [file join $defaultMountPoint test] \
+ [list -archive [zippath test.zip] -compsize 5 -crc [expr 0x3BB935C6] -mount $defaultMountPoint -offset 55 -permissions 0o555 -uncompsize 5]
+ testzipfsfileattr dir [file join $defaultMountPoint testdir] \
+ [list -archive [zippath test.zip] -compsize 0 -crc 0 -mount $defaultMountPoint -offset 119 -permissions 0o555 -uncompsize 0]
+ testzipfsfileattr root [zipfs root] {} {} -constraints bug-4af110a6a1
+ testzipfsfileattr mountpoint $defaultMountPoint \
+ [list -archive [zippath test.zip] -compsize 0 -crc 0 -mount $defaultMountPoint -offset 0 -permissions 0o555 -uncompsize 0]
+ testzipfsfileattr mezzo [file join $defaultMountPoint a b] {} [file join $defaultMountPoint a b c] -constraints bug-4af110a6a1
+
#
# TODO - file copy, file rename etc.