2001-11-01 Vince Darley <vincentdarley@sourceforge.net>
* generic/vfs.c: 'vfs::mount' no longer a string-literal
+ * tests/vfs*.test: various new tests added
2001-10-31 Vince Darley <vincentdarley@sourceforge.net>
* examples/simpleExamples.tcl: a demo
test vfs-1.1 {mount unmount} {
vfs::filesystem mount foo bar
- set res [list [catch {vfs::filesystem unmount foo bar} err]]
+ set res [list [catch {vfs::filesystem unmount foo bar blah} err]]
lappend res $err
vfs::filesystem unmount foo
unset err
set res
-} {1 {wrong # args: should be "vfs::filesystem unmount path"}}
+} {1 {wrong # args: should be "vfs::filesystem unmount ?-volume? path"}}
# cleanup
::tcltest::cleanupTests
}
package require vfs
+if {![auto_load ::vfs::urltype::Mount]} {
+ lappend auto_path [file join [file dirname \
+ [file dirname [file normalize [info script]]]] library]
+}
test vfsUrl-1.1 {mount} {
vfs::urltype::Mount ftp
file exists ftp://ftp.scriptics.com
} {1}
+test vfsUrl-1.2.1 {mounted volumes} {
+ set idx [lsearch -exact [file volumes] ftp://]
+ if {$idx < 0} {
+ set res "No ftp:// volume!"
+ } else {
+ set res "New volume 'ftp://' mounted"
+ }
+ set res
+} {New volume 'ftp://' mounted}
+
test vfsUrl-1.3 {mount} {
file delete -force README.tclversions
file copy ftp://ftp.scriptics.com/pub/tcl/README.tclversions .
} {file doesn't exist}
# cleanup
+catch {
+ if {[lsearch -exact "ftp://" [file volumes]] != -1} {
+ vfs::urltype::Unmount ftp
+ }
+ if {[lsearch -exact "http://" [file volumes]] != -1} {
+ vfs::urltype::Unmount http
+ }
+
+}
+
::tcltest::cleanupTests
return