better tests
authorVince Darley <vincentdarley@sourceforge.net>
Mon, 29 Apr 2002 17:23:39 +0000 (17:23 +0000)
committerVince Darley <vincentdarley@sourceforge.net>
Mon, 29 Apr 2002 17:23:39 +0000 (17:23 +0000)
ChangeLog
Readme.txt
library/tclIndex
mac/Vfs.mcp.xml
mac/vfs.r
tests/vfs.test

index c40c468809b23b49728d41c0ab1e56ed4d0089af..d08af5f55bb4c531f5cac1f7fd069a77149121e3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-04-27  Vince Darley <vincentdarley@sourceforge.net>
+       * 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 <jcw@equi4.com>
        * library/*vfs.tcl: switching to vfs::{crc,memchan,zip}
        * library/vfsUtils.tcl: fixed env to be global, added unset
index 441463ca2b90d37cadce0ce9d3b6242fbc576ae0..91989bdea3b68dd883d77e64a69917c6a8e32036 100644 (file)
@@ -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
index f057c0605e066763db675653e377053bf5d6647a..10122877299b76d2cf56b50356daef4082c04ceb 100644 (file)
@@ -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]]
index 772ada71712547f1bee7a5eb5658fbbedbbd06ce..58715f2f79f15be4df50bfe27c576ff43f87c6e5 100644 (file)
                     <FILEKIND>Text</FILEKIND>
                     <FILEFLAGS></FILEFLAGS>
                 </FILE>
-                <FILE>
-                    <PATHTYPE>PathRelative</PATHTYPE>
-                    <PATHROOT>Project</PATHROOT>
-                    <ACCESSPATH>::library:</ACCESSPATH>
-                    <PATH>:scripdoc.tcl</PATH>
-                    <PATHFORMAT>MacOS</PATHFORMAT>
-                    <FILEKIND>Text</FILEKIND>
-                    <FILEFLAGS></FILEFLAGS>
-                </FILE>
-                <FILE>
-                    <PATHTYPE>PathRelative</PATHTYPE>
-                    <PATHROOT>Project</PATHROOT>
-                    <ACCESSPATH>::library:</ACCESSPATH>
-                    <PATH>:vfs.tcl</PATH>
-                    <PATHFORMAT>MacOS</PATHFORMAT>
-                    <FILEKIND>Text</FILEKIND>
-                    <FILEFLAGS></FILEFLAGS>
-                </FILE>
                 <FILE>
                     <PATHTYPE>PathRelative</PATHTYPE>
                     <PATHROOT>Project</PATHROOT>
                         <PATH>:mk4vfs.tcl</PATH>
                         <PATHFORMAT>MacOS</PATHFORMAT>
                     </FILEREF>
-                    <FILEREF>
-                        <PATHTYPE>PathRelative</PATHTYPE>
-                        <PATHROOT>Project</PATHROOT>
-                        <ACCESSPATH>::library:</ACCESSPATH>
-                        <PATH>:scripdoc.tcl</PATH>
-                        <PATHFORMAT>MacOS</PATHFORMAT>
-                    </FILEREF>
-                    <FILEREF>
-                        <PATHTYPE>PathRelative</PATHTYPE>
-                        <PATHROOT>Project</PATHROOT>
-                        <ACCESSPATH>::library:</ACCESSPATH>
-                        <PATH>:vfs.tcl</PATH>
-                        <PATHFORMAT>MacOS</PATHFORMAT>
-                    </FILEREF>
                     <FILEREF>
                         <PATHTYPE>PathRelative</PATHTYPE>
                         <PATHROOT>Project</PATHROOT>
                     <FILEKIND>Text</FILEKIND>
                     <FILEFLAGS></FILEFLAGS>
                 </FILE>
-                <FILE>
-                    <PATHTYPE>PathRelative</PATHTYPE>
-                    <PATHROOT>Project</PATHROOT>
-                    <ACCESSPATH>::library:</ACCESSPATH>
-                    <PATH>:scripdoc.tcl</PATH>
-                    <PATHFORMAT>MacOS</PATHFORMAT>
-                    <FILEKIND>Text</FILEKIND>
-                    <FILEFLAGS></FILEFLAGS>
-                </FILE>
-                <FILE>
-                    <PATHTYPE>PathRelative</PATHTYPE>
-                    <PATHROOT>Project</PATHROOT>
-                    <ACCESSPATH>::library:</ACCESSPATH>
-                    <PATH>:vfs.tcl</PATH>
-                    <PATHFORMAT>MacOS</PATHFORMAT>
-                    <FILEKIND>Text</FILEKIND>
-                    <FILEFLAGS></FILEFLAGS>
-                </FILE>
                 <FILE>
                     <PATHTYPE>PathRelative</PATHTYPE>
                     <PATHROOT>Project</PATHROOT>
                     <PATH>:mk4vfs.tcl</PATH>
                     <PATHFORMAT>MacOS</PATHFORMAT>
                 </FILEREF>
-                <FILEREF>
-                    <PATHTYPE>PathRelative</PATHTYPE>
-                    <PATHROOT>Project</PATHROOT>
-                    <ACCESSPATH>::library:</ACCESSPATH>
-                    <PATH>:scripdoc.tcl</PATH>
-                    <PATHFORMAT>MacOS</PATHFORMAT>
-                </FILEREF>
-                <FILEREF>
-                    <PATHTYPE>PathRelative</PATHTYPE>
-                    <PATHROOT>Project</PATHROOT>
-                    <ACCESSPATH>::library:</ACCESSPATH>
-                    <PATH>:vfs.tcl</PATH>
-                    <PATHFORMAT>MacOS</PATHFORMAT>
-                </FILEREF>
                 <FILEREF>
                     <PATHTYPE>PathRelative</PATHTYPE>
                     <PATHROOT>Project</PATHROOT>
                 <PATH>:mk4vfs.tcl</PATH>
                 <PATHFORMAT>MacOS</PATHFORMAT>
             </FILEREF>
-            <FILEREF>
-                <TARGETNAME>Vfs Extension-C68k</TARGETNAME>
-                <PATHTYPE>PathRelative</PATHTYPE>
-                <PATHROOT>Project</PATHROOT>
-                <ACCESSPATH>::library:</ACCESSPATH>
-                <PATH>:scripdoc.tcl</PATH>
-                <PATHFORMAT>MacOS</PATHFORMAT>
-            </FILEREF>
             <FILEREF>
                 <TARGETNAME>Vfs Extension-C68k</TARGETNAME>
                 <PATHTYPE>PathRelative</PATHTYPE>
                 <PATH>:testvfs.tcl</PATH>
                 <PATHFORMAT>MacOS</PATHFORMAT>
             </FILEREF>
-            <FILEREF>
-                <TARGETNAME>Vfs Extension-C68k</TARGETNAME>
-                <PATHTYPE>PathRelative</PATHTYPE>
-                <PATHROOT>Project</PATHROOT>
-                <ACCESSPATH>::library:</ACCESSPATH>
-                <PATH>:vfs.tcl</PATH>
-                <PATHFORMAT>MacOS</PATHFORMAT>
-            </FILEREF>
             <FILEREF>
                 <TARGETNAME>Vfs Extension-C68k</TARGETNAME>
                 <PATHTYPE>PathRelative</PATHTYPE>
index 50aed1528866506b8ce0b6c51014039aa20ec2f2..4dcf33fb3ae65e3d3aa12d5539b69a071bcd4167 100644 (file)
--- 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";
index cb59db9e8e0861ea74c425cda430bedef56c51c5..d5b51724d8c227a4cbd53cd3f6fab1671ecf5910 100644 (file)
@@ -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