# Tcl zlib true round-trip: gzip-compress a payload with libz, gunzip it back, # and assert byte-identity plus that compression actually shrank it. Emits an # R- line (so the harness can tell "ran but failed" from "crashed before output") # and ZLIB-RT-OK on success. set s [string repeat "the quick brown fox jumps over the lazy dog 0123456789\n" 64] if {[catch { set c [zlib gzip $s] set d [zlib gunzip $c] } err]} { puts "R-err $err" puts "ZLIB-RT-FAIL" exit 1 } puts "R-len [string length $c]/[string length $s]" if {$d eq $s && [string length $c] < [string length $s]} { puts "ZLIB-RT-OK" } else { puts "ZLIB-RT-FAIL" exit 1 }