From: Vince Darley Date: Thu, 1 Nov 2001 17:08:44 +0000 (+0000) Subject: tests X-Git-Tag: vfs-1-2~93 X-Git-Url: https://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=9f38197daf9accd209d87f65f921f12af4c478e3;p=tclvfs tests --- diff --git a/doc/vfslib.n b/doc/vfslib.n index 44ea347..f84425d 100644 --- a/doc/vfslib.n +++ b/doc/vfslib.n @@ -44,7 +44,9 @@ evaluate the command .PP \fIvfs::urltype::Mount ftp\fR .PP -for instance. +for instance. Any access inside the new volume will result in an +attempt to mount a new path through 'vfs::${type}::Mount', which must +therefore exist, or errors will be thrown. .PP .SH LIMITATIONS .PP diff --git a/tests/vfsUrl.test b/tests/vfsUrl.test index 60f6c40..b367ade 100644 --- a/tests/vfsUrl.test +++ b/tests/vfsUrl.test @@ -29,7 +29,7 @@ test vfsUrl-1.2 {mount} { file exists ftp://ftp.scriptics.com } {1} -test vfsUrl-1.2.1 {mounted volumes} { +test vfsUrl-1.3 {mounted volumes} { set idx [lsearch -exact [file volumes] ftp://] if {$idx < 0} { set res "No ftp:// volume!" @@ -39,7 +39,7 @@ test vfsUrl-1.2.1 {mounted volumes} { set res } {New volume 'ftp://' mounted} -test vfsUrl-1.3 {mount} { +test vfsUrl-2.1 {auto-mount ftp and copy file} { file delete -force README.tclversions file copy ftp://ftp.scriptics.com/pub/tcl/README.tclversions . set to README.tclversions @@ -56,7 +56,7 @@ test vfsUrl-1.3 {mount} { set res } {ok} -test vfsUrl-1.4 {file copy with typo} { +test vfsUrl-2.2 {auto-mount bad ftp} { catch {file copy ftp://ftp.scriptxxics.com/pub/tcl/README.tclversions .} set to README.tclversions if {[file exists $to]} { @@ -68,15 +68,17 @@ test vfsUrl-1.4 {file copy with typo} { set res } {file doesn't exist} +test vfsUrl-3.1 {mount} { +} {} + # cleanup catch { - if {[lsearch -exact "ftp://" [file volumes]] != -1} { - vfs::urltype::Unmount ftp - } - if {[lsearch -exact "http://" [file volumes]] != -1} { - vfs::urltype::Unmount http + # Unmount all successfully mounted volumes. + foreach vol [file volumes] { + if {[regexp {^([a-zA-Z]+):/?//$} $vol "" type]} { + catch {vfs::urltype::Unmount $type} + } } - } ::tcltest::cleanupTests