summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2015-12-19 21:58:57 (GMT)
committerfvogel <fvogelnew1@free.fr>2015-12-19 21:58:57 (GMT)
commit8d5c02b36bab0cd28bbb503d248bdee783c9e3ef (patch)
tree6830d61138a83318c3dc2d395aefeed89c1b41b4 /tests
parentf1cf5c007e9c473a2904d54314fd2761a44a3267 (diff)
parenteb0c5a2b21fcefd1331e9ccf98b5f2bdc62f9395 (diff)
downloadtk-8d5c02b36bab0cd28bbb503d248bdee783c9e3ef.zip
tk-8d5c02b36bab0cd28bbb503d248bdee783c9e3ef.tar.gz
tk-8d5c02b36bab0cd28bbb503d248bdee783c9e3ef.tar.bz2
Fixed bug [1700065] - error in trace proc on textvariable doesn't trigger bgerror
Diffstat (limited to 'tests')
-rw-r--r--tests/entry.test21
-rw-r--r--tests/spinbox.test16
2 files changed, 33 insertions, 4 deletions
diff --git a/tests/entry.test b/tests/entry.test
index 27acfc1..da8f280 100644
--- a/tests/entry.test
+++ b/tests/entry.test
@@ -1621,13 +1621,26 @@ test entry-22.1 {lost namespaced textvar} {
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} result
- list [.e get] [.e cget -textvar] $result
+ 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
} [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} {
+ destroy .e
+ 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
+} [list {can't set "myvar": Intentional error here!} \
+ {can't set "myvar": Intentional error here!}]
+
destroy .e
# XXX Still need to write tests for EntryBlinkProc, EntryFocusProc,
diff --git a/tests/spinbox.test b/tests/spinbox.test
index 0661635..5fba390 100644
--- a/tests/spinbox.test
+++ b/tests/spinbox.test
@@ -1583,6 +1583,22 @@ test spinbox-23.1 {selection present while disabled, bug 637828} {
} {1 1 345}
destroy .e
+
+test spinbox-24.1 {error in trace proc attached to the textvariable} {
+ destroy .s
+ 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
+} [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!}]
+
catch {unset ::e ::vVals}
##