From: Pat Thoyts Date: Thu, 22 Jan 2009 16:03:58 +0000 (+0000) Subject: Fix the vfs::crc function and test to conform to its actual use in the zipvfs code. X-Git-Url: https://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=f65b1188b9140801e7d129ca7c564067a5342ee4;p=tclvfs Fix the vfs::crc function and test to conform to its actual use in the zipvfs code. --- diff --git a/library/vfsUtils.tcl b/library/vfsUtils.tcl index a146c2b..f853725 100644 --- a/library/vfsUtils.tcl +++ b/library/vfsUtils.tcl @@ -13,18 +13,21 @@ namespace eval ::vfs { } # This can be overridden to use a different memchan implementation +# With Tcl 8.6 will be overridden using [chan create] via vfslib.tcl proc ::vfs::memchan {args} { ::package require Memchan uplevel 1 [list ::memchan] $args } # This can be overridden to use a different crc implementation +# With Tcl 8.6 will be overridden using [zlib crc32] via vfslib.tcl proc ::vfs::crc {args} { - ::package require Trf - uplevel 1 [linsert [linsert $args end-1 "--"] 0 ::crc] + ::package require crc32 ;# tcllib + uplevel 1 [linsert [linsert $args end-1 "--"] 0 ::crc::crc32] } # This can be overridden to use a different zip implementation +# With Tcl 8.6 will be overridden using core zlib via vfslib.tcl proc ::vfs::zip {args} { ::package require Trf uplevel 1 [linsert [linsert $args end-1 "--"] 0 ::zip] diff --git a/tests/vfs.test b/tests/vfs.test index fbc91d6..7cbc1aa 100644 --- a/tests/vfs.test +++ b/tests/vfs.test @@ -129,8 +129,8 @@ test vfs-3.2 {vfs helpers: crc} { # What this means is that tclvfs can't find some other # extension/code it requires -- you may need to install # the Trf extension for example. - ::vfs::crc abcd -} {Kc*} + format %08x [::vfs::crc abcd] +} {ed82cd11} test vfs-3.3 {vfs helpers: zip} { # If this test fails, probably many other tests will fail too (at