diff options
Diffstat (limited to 'tests/unload.test')
-rw-r--r-- | tests/unload.test | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/tests/unload.test b/tests/unload.test index d26f012..761f05c 100644 --- a/tests/unload.test +++ b/tests/unload.test @@ -11,7 +11,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: unload.test,v 1.6 2006/12/17 03:47:08 das Exp $ +# RCS: @(#) $Id: unload.test,v 1.7 2008/04/23 15:44:38 dkf Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 @@ -41,27 +41,27 @@ set alreadyTotalLoaded [info loaded] testConstraint teststaticpkg [llength [info commands teststaticpkg]] # Basic tests: parameter testing... -test unload-1.1 {basic errors} {} { - list [catch {unload} msg] $msg -} "1 {wrong \# args: should be \"unload ?switches? fileName ?packageName? ?interp?\"}" -test unload-1.2 {basic errors} {} { - list [catch {unload a b c d} msg] $msg -} "1 {wrong \# args: should be \"unload ?switches? fileName ?packageName? ?interp?\"}" -test unload-1.3 {basic errors} {} { - list [catch {unload a b foobar} msg] $msg -} {1 {could not find interpreter "foobar"}} -test unload-1.4 {basic errors} {} { - list [catch {unload {}} msg] $msg -} {1 {must specify either file name or package name}} -test unload-1.5 {basic errors} {} { - list [catch {unload {} {}} msg] $msg -} {1 {must specify either file name or package name}} -test unload-1.6 {basic errors} {} { - list [catch {unload {} Unknown} msg] $msg -} {1 {package "Unknown" is loaded statically and cannot be unloaded}} -test unload-1.7 {-nocomplain switch} {} { - list [unload -nocomplain {} Unknown] -} {{}} +test unload-1.1 {basic errors} -returnCodes error -body { + unload +} -result {wrong # args: should be "unload ?switches? fileName ?packageName? ?interp?"} +test unload-1.2 {basic errors} -returnCodes error -body { + unload a b c d +} -result {wrong # args: should be "unload ?switches? fileName ?packageName? ?interp?"} +test unload-1.3 {basic errors} -returnCodes error -body { + unload a b foobar +} -result {could not find interpreter "foobar"} +test unload-1.4 {basic errors} -returnCodes error -body { + unload {} +} -result {must specify either file name or package name} +test unload-1.5 {basic errors} -returnCodes error -body { + unload {} {} +} -result {must specify either file name or package name} +test unload-1.6 {basic errors} -returnCodes error -body { + unload {} Unknown +} -result {package "Unknown" is loaded statically and cannot be unloaded} +test unload-1.7 {-nocomplain switch} { + unload -nocomplain {} Unknown +} {} set pkgua_loaded {} set pkgua_detached {} |