summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2015-03-21 15:08:35 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2015-03-21 15:08:35 (GMT)
commitd7c6dcbdcddc3c35e9d243a50a8a9f9931a19fd6 (patch)
treedee2b8442329dbf2829bc09e204b9cbfaa14bdbe /tests
parent2f2d5349581870cceac22559969ccfdf9d55556b (diff)
downloadtcl-d7c6dcbdcddc3c35e9d243a50a8a9f9931a19fd6.zip
tcl-d7c6dcbdcddc3c35e9d243a50a8a9f9931a19fd6.tar.gz
tcl-d7c6dcbdcddc3c35e9d243a50a8a9f9931a19fd6.tar.bz2
adding a test to reveal a problem with the fix of bug d87cb182053fd79b3
Diffstat (limited to 'tests')
-rw-r--r--tests/tailcall.test30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/tailcall.test b/tests/tailcall.test
index 2d04f82..26f3cbf 100644
--- a/tests/tailcall.test
+++ b/tests/tailcall.test
@@ -147,6 +147,36 @@ test tailcall-0.5 {tailcall is constant space} -constraints testnrelevels -setup
rename b {}
} -result {0 0 0 0 0 0}
+test tailcall-0.5.1 {tailcall is constant space} -constraints testnrelevels -setup {
+ #
+ # This test is related to [bug d87cb182053fd79b3]: the fix to that bug was
+ # to remove a call to TclSkipTailcall, which caused a violation of the
+ # constant-space property of tailcall in that particular
+ # configuration. This test was added to detect that, and insure that the
+ # problem is fixed.
+ #
+
+ proc b i {
+ if {$i == 1} {
+ depthDiff
+ }
+ if {[incr i] > 10} {
+ return [depthDiff]
+ }
+ tailcall dict b $i
+ }
+ set map0 [namespace ensemble configure dict -map]
+ set map $map0
+ dict set map b b
+ namespace ensemble configure dict -map $map
+} -body {
+ dict b 0
+} -cleanup {
+ rename b {}
+ namespace ensemble configure dict -map $map0
+ unset map map0
+} -result {0 0 0 0 0 0}
+
test tailcall-0.6 {tailcall is constant space} -constraints {testnrelevels knownBug} -setup {
#
# This test fails because ns-unknown is not NR-enabled