summaryrefslogtreecommitdiffstats
path: root/tests/zlib.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/zlib.test')
-rw-r--r--tests/zlib.test35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/zlib.test b/tests/zlib.test
index d8d710a..6c0e4f8 100644
--- a/tests/zlib.test
+++ b/tests/zlib.test
@@ -169,6 +169,41 @@ test zlib-8.4 {transformation and flushing: Bug 3517696} -setup {
catch {close $fd}
removeFile $file
} -result {}
+test zlib-8.5 {transformation and fconfigure} -setup {
+ set file [makeFile {} test.z]
+ set fd [open $file wb]
+} -constraints zlib -body {
+ list [fconfigure $fd] [zlib push compress $fd; fconfigure $fd] \
+ [chan pop $fd; fconfigure $fd]
+} -cleanup {
+ catch {close $fd}
+ removeFile $file
+} -result {{-blocking 1 -buffering full -buffersize 4096 -encoding binary -eofchar {} -translation lf} {-blocking 1 -buffering full -buffersize 4096 -encoding binary -eofchar {} -translation lf -checksum 1 -dictionary {}} {-blocking 1 -buffering full -buffersize 4096 -encoding binary -eofchar {} -translation lf}}
+test zlib-8.6 {transformation and fconfigure} -setup {
+ set file [makeFile {} test.gz]
+ set fd [open $file wb]
+} -constraints zlib -body {
+ list [fconfigure $fd] [zlib push gzip $fd; fconfigure $fd] \
+ [chan pop $fd; fconfigure $fd]
+} -cleanup {
+ catch {close $fd}
+ removeFile $file
+} -result {{-blocking 1 -buffering full -buffersize 4096 -encoding binary -eofchar {} -translation lf} {-blocking 1 -buffering full -buffersize 4096 -encoding binary -eofchar {} -translation lf -checksum 0} {-blocking 1 -buffering full -buffersize 4096 -encoding binary -eofchar {} -translation lf}}
+test zlib-8.7 {transformtion and fconfigure} -setup {
+ lassign [chan pipe] inSide outSide
+ set msg [string repeat "am i all that i am at all? i am all that i am!" 400]
+ set dict "thatallam i "
+} -constraints zlib -body {
+ zlib push compress $outSide -dictionary $dict
+ fconfigure $outSide -blocking 0 -translation binary -buffering none
+ fconfigure $inSide -blocking 0 -translation binary
+ puts -nonewline $outSide $msg
+ chan pop $outSide
+ string length [read $inSide]
+} -cleanup {
+ catch {close $outSide}
+ catch {close $inSide}
+} -result 103
test zlib-9.1 "check fcopy with push" -constraints zlib -setup {
set sfile [makeFile {} testsrc.gz]