From: Vince Darley Date: Mon, 29 Apr 2002 17:23:39 +0000 (+0000) Subject: better tests X-Git-Tag: vfs-1-2~51 X-Git-Url: https://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=8055f3fa01d6df99a3686ba929caf38df5823ae7;p=tclvfs better tests --- diff --git a/ChangeLog b/ChangeLog index c40c468..d08af5f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-04-27 Vince Darley + * tests/vfs.test: tests work independent of directory in which + they run. Tests added to check that at least 'vfs::memchan' + basically works. + * mac/*: updated for removal of scripdoc.tcl and vfs.tcl + 2002-04-25 Jean-Claude Wippler * library/*vfs.tcl: switching to vfs::{crc,memchan,zip} * library/vfsUtils.tcl: fixed env to be global, added unset diff --git a/Readme.txt b/Readme.txt index 441463c..91989bd 100644 --- a/Readme.txt +++ b/Readme.txt @@ -151,7 +151,7 @@ you couldn't hook the code up to input/output pipes). Debugging virtual filesystems ----------------------------- -Bugs in Tcl vfs's are hard to track down, since error messages can't +Bugs in Tcl vfs's are hard to track down, since error _messages_ can't necessarily propagate to the toplevel (errors of course do propagate and result in a filesystem action failing, but informative error messages cannot usually be provided, since Tcl is only expecting one of the standard POSIX diff --git a/library/tclIndex b/library/tclIndex index f057c06..1012287 100644 --- a/library/tclIndex +++ b/library/tclIndex @@ -97,7 +97,7 @@ set auto_index(::vfs::urltype::deletefile) [list source [file join $dir vfsUrl.t set auto_index(::vfs::urltype::fileattributes) [list source [file join $dir vfsUrl.tcl]] set auto_index(::vfs::urltype::utime) [list source [file join $dir vfsUrl.tcl]] set auto_index(::vfs::memchan) [list source [file join $dir vfsUtils.tcl]] -set auto_index(::vfs::zlib) [list source [file join $dir vfsUtils.tcl]] +set auto_index(::vfs::crc) [list source [file join $dir vfsUtils.tcl]] set auto_index(::vfs::zip) [list source [file join $dir vfsUtils.tcl]] set auto_index(::vfs::autoMountExtension) [list source [file join $dir vfsUtils.tcl]] set auto_index(::vfs::autoMountUrl) [list source [file join $dir vfsUtils.tcl]] diff --git a/mac/Vfs.mcp.xml b/mac/Vfs.mcp.xml index 772ada7..58715f2 100644 --- a/mac/Vfs.mcp.xml +++ b/mac/Vfs.mcp.xml @@ -991,24 +991,6 @@ Text - - PathRelative - Project - ::library: - :scripdoc.tcl - MacOS - Text - - - - PathRelative - Project - ::library: - :vfs.tcl - MacOS - Text - - PathRelative Project @@ -1163,20 +1145,6 @@ :mk4vfs.tcl MacOS - - PathRelative - Project - ::library: - :scripdoc.tcl - MacOS - - - PathRelative - Project - ::library: - :vfs.tcl - MacOS - PathRelative Project @@ -2129,24 +2097,6 @@ Text - - PathRelative - Project - ::library: - :scripdoc.tcl - MacOS - Text - - - - PathRelative - Project - ::library: - :vfs.tcl - MacOS - Text - - PathRelative Project @@ -2298,20 +2248,6 @@ :mk4vfs.tcl MacOS - - PathRelative - Project - ::library: - :scripdoc.tcl - MacOS - - - PathRelative - Project - ::library: - :vfs.tcl - MacOS - PathRelative Project @@ -2961,14 +2897,6 @@ :mk4vfs.tcl MacOS - - Vfs Extension-C68k - PathRelative - Project - ::library: - :scripdoc.tcl - MacOS - Vfs Extension-C68k PathRelative @@ -2985,14 +2913,6 @@ :testvfs.tcl MacOS - - Vfs Extension-C68k - PathRelative - Project - ::library: - :vfs.tcl - MacOS - Vfs Extension-C68k PathRelative diff --git a/mac/vfs.r b/mac/vfs.r index 50aed15..4dcf33f 100644 --- a/mac/vfs.r +++ b/mac/vfs.r @@ -102,10 +102,8 @@ read 'TEXT' (VFS_LIBRARY_RESOURCES + 1, "vfs:tclIndex", purgeable) "tclIndex.tcl read 'TEXT' (VFS_LIBRARY_RESOURCES + 2, "ftpvfs", purgeable) "ftpvfs.tcl"; read 'TEXT' (VFS_LIBRARY_RESOURCES + 3, "httpvfs", purgeable) "httpvfs.tcl"; read 'TEXT' (VFS_LIBRARY_RESOURCES + 4, "mk4vfs", purgeable) "mk4vfs.tcl"; -read 'TEXT' (VFS_LIBRARY_RESOURCES + 5, "scripdoc", purgeable) "scripdoc.tcl"; read 'TEXT' (VFS_LIBRARY_RESOURCES + 6, "tclprocvfs", purgeable) "tclprocvfs.tcl"; read 'TEXT' (VFS_LIBRARY_RESOURCES + 7, "testvfs", purgeable) "testvfs.tcl"; -read 'TEXT' (VFS_LIBRARY_RESOURCES + 8, "vfs", purgeable) "vfs.tcl"; read 'TEXT' (VFS_LIBRARY_RESOURCES + 9, "vfsUrl", purgeable) "vfsUrl.tcl"; read 'TEXT' (VFS_LIBRARY_RESOURCES + 10, "vfsUtils", purgeable) "vfsUtils.tcl"; read 'TEXT' (VFS_LIBRARY_RESOURCES + 11, "zipvfs", purgeable) "zipvfs.tcl"; diff --git a/tests/vfs.test b/tests/vfs.test index cb59db9..d5b5172 100644 --- a/tests/vfs.test +++ b/tests/vfs.test @@ -4,7 +4,7 @@ # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # -# Copyright (c) 2001 by Vince Darley. +# Copyright (c) 2001-2002 by Vince Darley. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -87,6 +87,30 @@ test vfs-2.2 {mount, delete sub interp} { filelistrelative $res $remove } {foo2 foo foo} +test vfs-3.1 {vfs helpers: in memory channels} { + close [::vfs::memchan] + # If we get here, it's ok. If this test fails, + # probably many other tests will fail too. +} {} + +test vfs-3.2 {vfs helpers: crc} { + # If this test fails, probably many other tests will fail too (at + # least anything to do with 'zip' vfs). + ::vfs::crc abcd +} {Kc*} + +test vfs-3.3 {vfs helpers: zip} { + # If this test fails, probably many other tests will fail too (at + # least anything to do with 'zip' vfs). + ::vfs::zip -mode compress 1234567890 +} "\x78\x9c\x33\x34\x32\x36\x31\x35\x33\xb7\xb0\x34\x0\x0\xb\x2c\x2\xe" + +test vfs-3.4 {vfs helpers: zip} { + # If this test fails, probably many other tests will fail too (at + # least anything to do with 'zip' vfs). + ::vfs::zip -mode decompress "\x78\x9c\x33\x34\x32\x36\x31\x35\x33\xb7\xb0\x34\x0\x0\xb\x2c\x2\xe" +} {1234567890} + # cleanup ::tcltest::cleanupTests return