summaryrefslogtreecommitdiffstats
path: root/tests/rename.test
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-05-19 20:15:29 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-05-19 20:15:29 (GMT)
commite52d9cbf151b4d4106c36834e820db9442ec9a3b (patch)
treeb07002700fcbcc6b4ed86c424196b744184971a1 /tests/rename.test
parentcc56afda247802cb646330c25f3f03db20b1a43d (diff)
downloadtcl-e52d9cbf151b4d4106c36834e820db9442ec9a3b.zip
tcl-e52d9cbf151b4d4106c36834e820db9442ec9a3b.tar.gz
tcl-e52d9cbf151b4d4106c36834e820db9442ec9a3b.tar.bz2
Massive test cleanup; all tests are run, and constraints are used where necessary.
Diffstat (limited to 'tests/rename.test')
-rw-r--r--tests/rename.test116
1 files changed, 58 insertions, 58 deletions
diff --git a/tests/rename.test b/tests/rename.test
index a33afaa..45d6847 100644
--- a/tests/rename.test
+++ b/tests/rename.test
@@ -11,13 +11,15 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: rename.test,v 1.11 2004/03/30 16:22:22 msofer Exp $
+# RCS: @(#) $Id: rename.test,v 1.12 2004/05/19 20:15:32 dkf Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
namespace import -force ::tcltest::*
}
+testConstraint testdel [llength [info commands testdel]]
+
# Must eliminate the "unknown" command while the test is running,
# especially if the test is being run in a program with its
# own special-purpose unknown command.
@@ -77,65 +79,63 @@ catch {rename unknown {}}
catch {rename unknown.old unknown}
catch {rename bar {}}
-if {[info command testdel] == "testdel"} {
- test rename-4.1 {reentrancy issues with command deletion and renaming} {
- set x {}
- testdel {} foo {lappend x deleted; rename bar {}; lappend x [info command bar]}
- rename foo bar
- lappend x |
- rename bar {}
- set x
- } {| deleted {}}
- test rename-4.2 {reentrancy issues with command deletion and renaming} {
- set x {}
- testdel {} foo {lappend x deleted; rename foo bar}
- rename foo {}
- set x
- } {deleted}
- test rename-4.3 {reentrancy issues with command deletion and renaming} {
- set x {}
- testdel {} foo {lappend x deleted; testdel {} foo {lappend x deleted2}}
- rename foo {}
- lappend x |
- rename foo {}
- set x
- } {deleted | deleted2}
- test rename-4.4 {reentrancy issues with command deletion and renaming} {
- set x {}
- testdel {} foo {lappend x deleted; rename foo bar}
- rename foo {}
- lappend x | [info command bar]
- } {deleted | {}}
- test rename-4.5 {reentrancy issues with command deletion and renaming} {
- set env(value) before
- interp create foo
- testdel foo cmd {set env(value) deleted}
+test rename-4.1 {reentrancy issues with command deletion and renaming} testdel {
+ set x {}
+ testdel {} foo {lappend x deleted; rename bar {}; lappend x [info command bar]}
+ rename foo bar
+ lappend x |
+ rename bar {}
+ set x
+} {| deleted {}}
+test rename-4.2 {reentrancy issues with command deletion and renaming} testdel {
+ set x {}
+ testdel {} foo {lappend x deleted; rename foo bar}
+ rename foo {}
+ set x
+} {deleted}
+test rename-4.3 {reentrancy issues with command deletion and renaming} testdel {
+ set x {}
+ testdel {} foo {lappend x deleted; testdel {} foo {lappend x deleted2}}
+ rename foo {}
+ lappend x |
+ rename foo {}
+ set x
+} {deleted | deleted2}
+test rename-4.4 {reentrancy issues with command deletion and renaming} testdel {
+ set x {}
+ testdel {} foo {lappend x deleted; rename foo bar}
+ rename foo {}
+ lappend x | [info command bar]
+} {deleted | {}}
+test rename-4.5 {reentrancy issues with command deletion and renaming} testdel {
+ set env(value) before
+ interp create foo
+ testdel foo cmd {set env(value) deleted}
+ interp delete foo
+ set env(value)
+} {deleted}
+test rename-4.6 {reentrancy issues with command deletion and renaming} testdel {
+ proc kill args {
+ interp delete foo
+ }
+ set env(value) before
+ interp create foo
+ foo alias kill kill
+ testdel foo cmd {set env(value) deleted; kill}
+ list [catch {foo eval {rename cmd {}}} msg] $msg $env(value)
+} {0 {} deleted}
+test rename-4.7 {reentrancy issues with command deletion and renaming} testdel {
+ proc kill args {
interp delete foo
- set env(value)
- } {deleted}
- test rename-4.6 {reentrancy issues with command deletion and renaming} {
- proc kill args {
- interp delete foo
- }
- set env(value) before
- interp create foo
- foo alias kill kill
- testdel foo cmd {set env(value) deleted; kill}
- list [catch {foo eval {rename cmd {}}} msg] $msg $env(value)
- } {0 {} deleted}
- test rename-4.7 {reentrancy issues with command deletion and renaming} {
- proc kill args {
- interp delete foo
- }
- set env(value) before
- interp create foo
- foo alias kill kill
- testdel foo cmd {set env(value) deleted; kill}
- list [catch {interp delete foo} msg] $msg $env(value)
- } {0 {} deleted}
- if {[info exists env(value)]} {
- unset env(value)
}
+ set env(value) before
+ interp create foo
+ foo alias kill kill
+ testdel foo cmd {set env(value) deleted; kill}
+ list [catch {interp delete foo} msg] $msg $env(value)
+} {0 {} deleted}
+if {[info exists env(value)]} {
+ unset env(value)
}
# Save the unknown procedure which is modified by the following test.