summaryrefslogtreecommitdiffstats
path: root/tests/unload.test
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2008-04-23 15:44:37 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2008-04-23 15:44:37 (GMT)
commit2806530fd57fcf8fdf0f65ef7b2778bcadfaa8ed (patch)
treeb898cceb637a2f5cc684d10d9956e40ee699ad36 /tests/unload.test
parent7346f5c47fd9b46f12a26714b5dde16148a5b932 (diff)
downloadtcl-2806530fd57fcf8fdf0f65ef7b2778bcadfaa8ed.zip
tcl-2806530fd57fcf8fdf0f65ef7b2778bcadfaa8ed.tar.gz
tcl-2806530fd57fcf8fdf0f65ef7b2778bcadfaa8ed.tar.bz2
Assorted improvements to make better use of tcltest2
Diffstat (limited to 'tests/unload.test')
-rw-r--r--tests/unload.test44
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 {}