summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2015-12-19 22:50:03 (GMT)
committerfvogel <fvogelnew1@free.fr>2015-12-19 22:50:03 (GMT)
commit05f8ab77f8dcabb1f3ad9394d48bc670277885e0 (patch)
tree467e89f0b026ad95e7d0e6919570f18df328abdb /tests
parentb0403585584cc0e6e4518f2cd03ac46fa21db2f9 (diff)
parent545a4416a85546b7b713c06ed8ca42c6932b9887 (diff)
downloadtk-05f8ab77f8dcabb1f3ad9394d48bc670277885e0.zip
tk-05f8ab77f8dcabb1f3ad9394d48bc670277885e0.tar.gz
tk-05f8ab77f8dcabb1f3ad9394d48bc670277885e0.tar.bz2
Fixed bug [1700065] - error in trace proc on textvariable doesn't trigger bgerror
Diffstat (limited to 'tests')
-rw-r--r--tests/entry.test29
-rw-r--r--tests/spinbox.test17
2 files changed, 39 insertions, 7 deletions
diff --git a/tests/entry.test b/tests/entry.test
index f261f0d..4cc9218 100644
--- a/tests/entry.test
+++ b/tests/entry.test
@@ -3460,8 +3460,6 @@ test entry-22.1 {lost namespaced textvar} -body {
namespace eval test { variable foo {a b} }
entry .e -textvariable ::test::foo
namespace delete test
- .e insert end "more stuff"
- .e delete 5 end
set ::test::foo
} -cleanup {
destroy .e
@@ -3470,13 +3468,30 @@ test entry-22.2 {lost namespaced textvar} -body {
namespace eval test { variable foo {a b} }
entry .e -textvariable ::test::foo
namespace delete test
- .e insert end "more stuff"
- .e delete 5 end
- catch {set ::test::foo}
- list [.e get] [.e cget -textvar]
+ catch {.e insert end "more stuff"} result1
+ catch {.e delete 5 end } result2
+ catch {set ::test::foo} result3
+ list [.e get] [.e cget -textvar] $result1 $result2 $result3
} -cleanup {
destroy .e
-} -result [list "a bmo" ::test::foo]
+} -result [list "a bmo" ::test::foo \
+ {can't set "::test::foo": parent namespace doesn't exist} \
+ {can't set "::test::foo": parent namespace doesn't exist} \
+ {can't read "::test::foo": no such variable}]
+
+test entry-23.1 {error in trace proc attached to the textvariable} -setup {
+ destroy .e
+} -body {
+ trace variable myvar w traceit
+ proc traceit args {error "Intentional error here!"}
+ entry .e -textvariable myvar
+ catch {.e insert end mystring} result1
+ catch {.e delete 0} result2
+ list $result1 $result2
+} -cleanup {
+ destroy .e
+} -result [list {can't set "myvar": Intentional error here!} \
+ {can't set "myvar": Intentional error here!}]
# Gathered comments about lacks
# XXX Still need to write tests for EntryBlinkProc, EntryFocusProc,
diff --git a/tests/spinbox.test b/tests/spinbox.test
index b8170c5..f101640 100644
--- a/tests/spinbox.test
+++ b/tests/spinbox.test
@@ -3790,6 +3790,23 @@ test spinbox-23.1 {selection present while disabled, bug 637828} -body {
destroy .e
} -result {1 1 345}
+test spinbox-24.1 {error in trace proc attached to the textvariable} -setup {
+ destroy .s
+} -body {
+ trace variable myvar w traceit
+ proc traceit args {error "Intentional error here!"}
+ spinbox .s -textvariable myvar -from 1 -to 10
+ catch {.s set mystring} result1
+ catch {.s insert 0 mystring} result2
+ catch {.s delete 0} result3
+ catch {.s invoke buttonup} result4
+ list $result1 $result2 $result3 $result4
+} -cleanup {
+ destroy .s
+} -result [list {can't set "myvar": Intentional error here!} \
+ {can't set "myvar": Intentional error here!} \
+ {can't set "myvar": Intentional error here!} \
+ {can't set "myvar": Intentional error here!}]
# Collected comments about lacks from the test
# XXX Still need to write tests for SpinboxBlinkProc, SpinboxFocusProc,