summaryrefslogtreecommitdiffstats
path: root/tests/case.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/case.test')
-rw-r--r--tests/case.test17
1 files changed, 6 insertions, 11 deletions
diff --git a/tests/case.test b/tests/case.test
index 1c12e3a..2960c9d 100644
--- a/tests/case.test
+++ b/tests/case.test
@@ -4,20 +4,15 @@
# built-in commands. Sourcing this file into Tcl runs the tests and
# generates output for errors. No output means no errors were found.
#
-# Copyright © 1991-1993 The Regents of the University of California.
-# Copyright © 1994 Sun Microsystems, Inc.
-# Copyright © 1998-1999 Scriptics Corporation.
+# Copyright (c) 1991-1993 The Regents of the University of California.
+# Copyright (c) 1994 Sun Microsystems, Inc.
+# Copyright (c) 1998-1999 by Scriptics Corporation.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-if {![llength [info commands case]]} {
- # No "case" command? So no need to test
- return
-}
-
-if {"::tcltest" ni [namespace children]} {
- package require tcltest 2.5
+if {[lsearch [namespace children] ::tcltest] == -1} {
+ package require tcltest
namespace import -force ::tcltest::*
}
@@ -54,7 +49,7 @@ test case-2.1 {error in executed command} {
"case a in a {error "Just a test"} default {format 1}"}}
test case-2.2 {error: not enough args} {
list [catch {case} msg] $msg
-} {1 {wrong # args: should be "case string ?in? ?pattern body ...? ?default body?"}}
+} {1 {wrong # args: should be "case string ?in? patList body ... ?default body?"}}
test case-2.3 {error: pattern with no body} {
list [catch {case a b} msg] $msg
} {1 {extra case pattern with no body}}