1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
# 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::ftp
puts stdout "These tests require an internet connection, and might"
puts stdout "take a long time to complete."
set dir [pwd]
test vfsFtp-1.1 {mount and cd} {
vfs::ftp::Mount ftp://ftp.ucsd.edu/pub/alpha/ localmount
cd localmount
cd tcl
file tail [pwd]
} {tcl}
test vfsFtp-1.2 {mount and glob} {
glob -nocomplain vfsTest.tcl
} {vfsTest.tcl}
test vfsFtp-1.3 {mount and source} {
source vfsTest.tcl
} {This was returned from a remote file}
# cleanup
catch {
vfs::ftp::Unmount ftp://ftp.ucsd.edu/pub/alpha/ localmount
}
cd $dir
::tcltest::cleanupTests
return
|