summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2023-10-05 10:43:42 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2023-10-05 10:43:42 (GMT)
commit071958ae7fb8f972146687e66362d23f4cde7ae5 (patch)
tree83d2df69afa6a9c0e9c6e87ca096ccd3dc1b08db /tests
parent600c5b59541d100659c84992a2e118b7eba65e41 (diff)
downloadtcl-071958ae7fb8f972146687e66362d23f4cde7ae5.zip
tcl-071958ae7fb8f972146687e66362d23f4cde7ae5.tar.gz
tcl-071958ae7fb8f972146687e66362d23f4cde7ae5.tar.bz2
zipfs file write - remove size limit, do not preallocate
Diffstat (limited to 'tests')
-rw-r--r--tests/zipfs.test21
1 files changed, 19 insertions, 2 deletions
diff --git a/tests/zipfs.test b/tests/zipfs.test
index 17dcc78..ea81825 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 {