diff options
author | dgp <dgp@users.sourceforge.net> | 2015-03-21 00:31:29 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2015-03-21 00:31:29 (GMT) |
commit | 2f2d5349581870cceac22559969ccfdf9d55556b (patch) | |
tree | 1a3e7a728d68d7262dc8813efab9525eca27463c /tests | |
parent | ee09bf7f95bff9d60eea22a0611c8fb8cd63d39c (diff) | |
download | tcl-2f2d5349581870cceac22559969ccfdf9d55556b.zip tcl-2f2d5349581870cceac22559969ccfdf9d55556b.tar.gz tcl-2f2d5349581870cceac22559969ccfdf9d55556b.tar.bz2 |
[d87cb18205] Let compiled ensembles handle tailcalls properly.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/nre.test | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/nre.test b/tests/nre.test index b5eb032..e512eac 100644 --- a/tests/nre.test +++ b/tests/nre.test @@ -151,6 +151,27 @@ test nre-4.1 {ensembles are not recursive} -setup { testnrelevels } -result {{0 2 1 1} 0} +test nre-4.2 {(compiled) ensembles do not break tailcall} -setup { + # Fix Bug d87cb18205 + proc b {} { + tailcall append result first + } + set map [namespace ensemble configure ::dict -map] + dict set map a b + namespace ensemble configure ::dict -map $map + proc demo {} { + dict a + append result second + } +} -body { + demo +} -cleanup { + rename demo {} + namespace ensemble configure ::dict -map [dict remove $map a] + unset map + rename b {} +} -result firstsecond + test nre-5.1 {[namespace eval] is not recursive} -setup { namespace eval ::foo { setabs |