From: Vince Darley Date: Thu, 1 Nov 2001 16:57:46 +0000 (+0000) Subject: tests X-Git-Tag: vfs-1-2~94 X-Git-Url: http://privyetmir.co.uk/gitweb?a=commitdiff_plain;h=b7f3ec83c58df15477f4401ffd34e334b96dc748;p=tclvfs tests --- diff --git a/tests/vfsFtp.test b/tests/vfsFtp.test new file mode 100644 index 0000000..35b3062 --- /dev/null +++ b/tests/vfsFtp.test @@ -0,0 +1,39 @@ +# Commands covered: vfs::ftp::Mount and friends. +# +# This file contains a collection of tests for one or more of the Tcl +# 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. +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# + +if {[lsearch [namespace children] ::tcltest] == -1} { + package require tcltest + namespace import ::tcltest::* +} + +package require vfs +if {![auto_load ::vfs::ftp::Mount]} { + lappend auto_path [file join [file dirname \ + [file dirname [file normalize [info script]]]] library] +} + +test vfsFtp-1.1 {mount and source} { + set dir [pwd] + vfs::ftp::Mount ftp://ftp.ucsd.edu/pub/alpha/ localmount + cd localmount ; cd tcl + set res [source vfsTest.tcl] + cd $dir + set res +} {This was returned from a remote file} + +# cleanup +catch { + vfs::ftp::Unmount ftp://ftp.ucsd.edu/pub/alpha/ localmount +} + +::tcltest::cleanupTests +return