summaryrefslogtreecommitdiffstats
path: root/tests/zipfs.test
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2023-10-05 11:07:44 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2023-10-05 11:07:44 (GMT)
commit48c88340a9fad7f5d8827ce38c68d6a55e5b7d2a (patch)
tree285cc1390bbe75d5450251a750fcad9a765a2ab1 /tests/zipfs.test
parent1cd654263730690628b68026df15dd43e94f8e66 (diff)
parent071958ae7fb8f972146687e66362d23f4cde7ae5 (diff)
downloadtcl-48c88340a9fad7f5d8827ce38c68d6a55e5b7d2a.zip
tcl-48c88340a9fad7f5d8827ce38c68d6a55e5b7d2a.tar.gz
tcl-48c88340a9fad7f5d8827ce38c68d6a55e5b7d2a.tar.bz2
Merge 8.7 - zipfs file write - remove size limit, do not preallocate
Diffstat (limited to 'tests/zipfs.test')
-rw-r--r--tests/zipfs.test21
1 files changed, 19 insertions, 2 deletions
diff --git a/tests/zipfs.test b/tests/zipfs.test
index 8f0cbf6..37f8156 100644
--- a/tests/zipfs.test
+++ b/tests/zipfs.test
@@ -1111,17 +1111,34 @@ namespace eval test_ns_zipfs {
} -result {file too large} -match glob -returnCodes error
test zipfs-write-size-limit-2 "Writes max size" -setup {
+ set origlimit $::tcl::zipfs::wrmax
+ set ::tcl::zipfs::wrmax 10000000
mount [zippath test.zip]
} -cleanup {
+ set ::tcl::zipfs::wrmax $origlimit
cleanup
} -body {
set fd [open [file join $defMountPt test] w]
puts -nonewline $fd [string repeat x $::tcl::zipfs::wrmax]
close $fd
file size [file join $defMountPt test]
- } -result $::tcl::zipfs::wrmax
+ } -result 10000000
+
+ test zipfs-write-size-limit-3 "Writes incrementally - buffer growth" -setup {
+ mount [zippath test.zip]
+ } -cleanup {
+ cleanup
+ } -body {
+ set fd [open [file join $defMountPt test] w]
+ fconfigure $fd -buffering none
+ for {set i 0} {$i < 100000} {incr i} {
+ puts -nonewline $fd 0123456789
+ }
+ close $fd
+ readbin [file join $defMountPt test]
+ } -result [string repeat 0123456789 100000]
- test zipfs-write-size-limit-3 "Writes disallowed" -setup {
+ test zipfs-write-size-limit-4 "Writes disallowed" -setup {
set origlimit $::tcl::zipfs::wrmax
mount [zippath test.zip]
} -cleanup {