diff options
author | apnadkarni <apnmbx-wits@yahoo.com> | 2023-09-26 05:22:22 (GMT) |
---|---|---|
committer | apnadkarni <apnmbx-wits@yahoo.com> | 2023-09-26 05:22:22 (GMT) |
commit | b730c0e5a483d8a0a348f211aadf08ec8e19be70 (patch) | |
tree | 46ffefd087b758ee809494281abb77f9bbb8db1f /tests | |
parent | d3ec5a1fb59c1b5e51d4492e69d5205300e3f2e8 (diff) | |
parent | b19cf92301ef772bd85dafa484d8271bd046f917 (diff) | |
download | tcl-b730c0e5a483d8a0a348f211aadf08ec8e19be70.zip tcl-b730c0e5a483d8a0a348f211aadf08ec8e19be70.tar.gz tcl-b730c0e5a483d8a0a348f211aadf08ec8e19be70.tar.bz2 |
Bug [d5d03207ca] - Tcl hang on zipfs writes greater than buffer size
Diffstat (limited to 'tests')
-rw-r--r-- | tests/zipfs.test | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/tests/zipfs.test b/tests/zipfs.test index 2c4775f..cb45b05 100644 --- a/tests/zipfs.test +++ b/tests/zipfs.test @@ -1073,7 +1073,7 @@ namespace eval test_ns_zipfs { set result } -result [list newtext test\n] - test zipfs-write-size-limit-0 "Writes have a size limit" -setup { + test zipfs-write-size-limit-0 "Writes more than size limit with flush" -setup { set origlimit $::tcl::zipfs::wrmax mount [zippath test.zip] } -cleanup { @@ -1083,10 +1083,35 @@ namespace eval test_ns_zipfs { } -body { set ::tcl::zipfs::wrmax 10 set fd [open [file join $defaultMountPoint test] w] - puts -nonewline $fd [string repeat x 11] - } -result {} -returnCodes error -constraints bug-d5d03207ca + puts $fd [string repeat x 11] + flush $fd + } -result {error flushing *: file too large} -match glob -returnCodes error - test zipfs-write-size-limit-1 "Writes disallowed" -setup { + test zipfs-write-size-limit-1 "Writes size limit on close" -setup { + set origlimit $::tcl::zipfs::wrmax + mount [zippath test.zip] + } -cleanup { + set ::tcl::zipfs::wrmax $origlimit + cleanup + } -body { + set ::tcl::zipfs::wrmax 10 + set fd [open [file join $defaultMountPoint test] w] + puts $fd [string repeat x 11] + close $fd + } -result {file too large} -match glob -returnCodes error + + test zipfs-write-size-limit-2 "Writes max size" -setup { + mount [zippath test.zip] + } -cleanup { + cleanup + } -body { + set fd [open [file join $defaultMountPoint test] w] + puts -nonewline $fd [string repeat x $::tcl::zipfs::wrmax] + close $fd + file size [file join $defaultMountPoint test] + } -result $::tcl::zipfs::wrmax + + test zipfs-write-size-limit-3 "Writes disallowed" -setup { set origlimit $::tcl::zipfs::wrmax mount [zippath test.zip] } -cleanup { |