summaryrefslogtreecommitdiffstats
path: root/tests/execute.test
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2019-06-20 19:43:58 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2019-06-20 19:43:58 (GMT)
commit4d2c1c10378e59e06a51982fa2ea7dc0a050944c (patch)
tree94b0b1fb887b9a2f1e1f33b698c9b88590b4738a /tests/execute.test
parent9fb3c12d536307a203a9798dbaf90ba52e0a6365 (diff)
parent6a1b394c2da63d8204ce3121cd7c3992095ed39c (diff)
downloadtcl-4d2c1c10378e59e06a51982fa2ea7dc0a050944c.zip
tcl-4d2c1c10378e59e06a51982fa2ea7dc0a050944c.tar.gz
tcl-4d2c1c10378e59e06a51982fa2ea7dc0a050944c.tar.bz2
[6bdadfba7d] Stop crash with multi-lappend and failing writes
Diffstat (limited to 'tests/execute.test')
-rw-r--r--tests/execute.test39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/execute.test b/tests/execute.test
index d4dbe5b..1d79f23 100644
--- a/tests/execute.test
+++ b/tests/execute.test
@@ -1062,6 +1062,45 @@ test execute-11.3 {Bug a0ece9d6d4} -setup {
trace remove execution crash enterstep {apply {args {info frame -2}}}
rename crash {}
} -result 1
+
+test execute-12.1 {failing multi-lappend to unshared} -setup {
+ unset -nocomplain x y
+} -body {
+ set x 1
+ lappend x 2 3
+ trace add variable x write {apply {args {error boo}}}
+ lappend x 4 5
+} -cleanup {
+ unset -nocomplain x y
+} -returnCodes error -result {can't set "x": boo}
+test execute-12.2 {failing multi-lappend to shared} -setup {
+ unset -nocomplain x y
+} -body {
+ set x 1
+ lappend x 2 3
+ set y $x
+ trace add variable x write {apply {args {error boo}}}
+ lappend x 4 5
+} -cleanup {
+ unset -nocomplain x y
+} -returnCodes error -result {can't set "x": boo}
+test execute-12.3 {failing multi-lappend to unshared: LVT} -body {
+ apply {{} {
+ set x 1
+ lappend x 2 3
+ trace add variable x write {apply {args {error boo}}}
+ lappend x 4 5
+ }}
+} -returnCodes error -result {can't set "x": boo}
+test execute-12.4 {failing multi-lappend to shared: LVT} -body {
+ apply {{} {
+ set x 1
+ lappend x 2 3
+ set y $x
+ trace add variable x write {apply {args {error boo}}}
+ lappend x 4 5
+ }}
+} -returnCodes error -result {can't set "x": boo}
# cleanup
if {[info commands testobj] != {}} {