summaryrefslogtreecommitdiff
path: root/tcl/tests/cmdInfo.test
diff options
context:
space:
mode:
Diffstat (limited to 'tcl/tests/cmdInfo.test')
-rw-r--r--tcl/tests/cmdInfo.test52
1 files changed, 20 insertions, 32 deletions
diff --git a/tcl/tests/cmdInfo.test b/tcl/tests/cmdInfo.test
index 2f3e0a20b89..3ddbc38b56f 100644
--- a/tcl/tests/cmdInfo.test
+++ b/tcl/tests/cmdInfo.test
@@ -16,58 +16,57 @@
# RCS: @(#) $Id$
if {[lsearch [namespace children] ::tcltest] == -1} {
- package require tcltest
+ package require tcltest 2
namespace import -force ::tcltest::*
}
-if {[info commands testcmdinfo] == {}} {
- puts "This application hasn't been compiled with the \"testcmdinfo\""
- puts "command, so I can't test Tcl_GetCommandInfo etc."
- ::tcltest::cleanupTests
- return
-}
+::tcltest::testConstraint testcmdinfo \
+ [llength [info commands testcmdinfo]]
+::tcltest::testConstraint testcmdtoken \
+ [llength [info commands testcmdtoken]]
-test cmdinfo-1.1 {command procedure and clientData} {
+test cmdinfo-1.1 {command procedure and clientData} {testcmdinfo} {
testcmdinfo create x1
testcmdinfo get x1
} {CmdProc1 original CmdDelProc1 original :: stringProc}
-test cmdinfo-1.2 {command procedure and clientData} {
+test cmdinfo-1.2 {command procedure and clientData} {testcmdinfo} {
testcmdinfo create x1
x1
} {CmdProc1 original}
-test cmdinfo-1.3 {command procedure and clientData} {
+test cmdinfo-1.3 {command procedure and clientData} {testcmdinfo} {
testcmdinfo create x1
testcmdinfo modify x1
testcmdinfo get x1
} {CmdProc2 new_command_data CmdDelProc2 new_delete_data :: stringProc}
-test cmdinfo-1.4 {command procedure and clientData} {
+test cmdinfo-1.4 {command procedure and clientData} {testcmdinfo} {
testcmdinfo create x1
testcmdinfo modify x1
x1
} {CmdProc2 new_command_data}
-test cmdinfo-2.1 {command deletion callbacks} {
+test cmdinfo-2.1 {command deletion callbacks} {testcmdinfo} {
testcmdinfo create x1
testcmdinfo delete x1
} {CmdDelProc1 original}
-test cmdinfo-2.2 {command deletion callbacks} {
+test cmdinfo-2.2 {command deletion callbacks} {testcmdinfo} {
testcmdinfo create x1
testcmdinfo modify x1
testcmdinfo delete x1
} {CmdDelProc2 new_delete_data}
-test cmdinfo-3.1 {Tcl_Get/SetCommandInfo return values} {
+test cmdinfo-3.1 {Tcl_Get/SetCommandInfo return values} {testcmdinfo} {
testcmdinfo get non_existent
} {??}
-test cmdinfo-3.2 {Tcl_Get/SetCommandInfo return values} {
+test cmdinfo-3.2 {Tcl_Get/SetCommandInfo return values} {testcmdinfo} {
testcmdinfo create x1
testcmdinfo modify x1
} 1
-test cmdinfo-3.3 {Tcl_Get/SetCommandInfo return values} {
+test cmdinfo-3.3 {Tcl_Get/SetCommandInfo return values} {testcmdinfo} {
testcmdinfo modify non_existent
} 0
-test cmdinfo-4.1 {Tcl_GetCommandName/Tcl_GetCommandFullName procedures} {
+test cmdinfo-4.1 {Tcl_GetCommandName/Tcl_GetCommandFullName procedures} \
+ {testcmdtoken} {
set x [testcmdtoken create x1]
rename x1 newName
set y [testcmdtoken name $x]
@@ -78,7 +77,8 @@ test cmdinfo-4.1 {Tcl_GetCommandName/Tcl_GetCommandFullName procedures} {
catch {rename newTestCmd {}}
catch {rename newTestCmd2 {}}
-test cmdinfo-5.1 {Names for commands created when inside namespaces} {
+test cmdinfo-5.1 {Names for commands created when inside namespaces} \
+ {testcmdtoken} {
# create namespace cmdInfoNs1
namespace eval cmdInfoNs1 {} ;# creates namespace cmdInfoNs1
# create namespace cmdInfoNs1::cmdInfoNs2 and execute a script in it
@@ -91,7 +91,8 @@ test cmdinfo-5.1 {Names for commands created when inside namespaces} {
eval lappend y [testcmdtoken name $x]
} {testCmd ::testCmd newTestCmd ::newTestCmd}
-test cmdinfo-6.1 {Names for commands created when outside namespaces} {
+test cmdinfo-6.1 {Names for commands created when outside namespaces} \
+ {testcmdtoken} {
set x [testcmdtoken create cmdInfoNs1::cmdInfoNs2::testCmd]
set y [testcmdtoken name $x]
rename cmdInfoNs1::cmdInfoNs2::testCmd newTestCmd2
@@ -103,16 +104,3 @@ catch {namespace delete cmdInfoNs1::cmdInfoNs2 cmdInfoNs1}
catch {rename x1 ""}
::tcltest::cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-
-