diff options
Diffstat (limited to 'tests/case.test')
| -rw-r--r-- | tests/case.test | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/case.test b/tests/case.test index 477538c..d7558a9 100644 --- a/tests/case.test +++ b/tests/case.test @@ -10,8 +10,11 @@ # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# RCS: @(#) $Id: case.test,v 1.6 2004/05/19 10:52:35 dkf Exp $ + +if {![llength [info commands case]]} { + # No "case" command? So no need to test + return +} if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -42,7 +45,7 @@ test case-1.7 {list of patterns} { test case-2.1 {error in executed command} { list [catch {case a in a {error "Just a test"} default {format 1}} msg] \ - $msg $errorInfo + $msg $::errorInfo } {1 {Just a test} {Just a test while executing "error "Just a test"" @@ -51,7 +54,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? patList body ... ?default body?"}} +} {1 {wrong # args: should be "case string ?in? ?pattern 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}} @@ -60,7 +63,7 @@ test case-2.4 {error: pattern with no body} { } {1 {extra case pattern with no body}} test case-2.5 {error in default command} { list [catch {case foo in a {error case1} default {error case2} \ - b {error case 3}} msg] $msg $errorInfo + b {error case 3}} msg] $msg $::errorInfo } {1 case2 {case2 while executing "error case2" |
