summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2015-12-21 12:12:06 (GMT)
committerfvogel <fvogelnew1@free.fr>2015-12-21 12:12:06 (GMT)
commit328dda2c290a201f8b0e6d2114f9a9e836bcb60a (patch)
tree95edbf2775f385130019de74bc06510673b84a7b /tests
parent36c62445d01d7dc3398bb08c1d828673267b644b (diff)
parenta1a3c3455aeb4fd0ec57f5e8c31105b29f5ff0a8 (diff)
downloadtk-328dda2c290a201f8b0e6d2114f9a9e836bcb60a.zip
tk-328dda2c290a201f8b0e6d2114f9a9e836bcb60a.tar.gz
tk-328dda2c290a201f8b0e6d2114f9a9e836bcb60a.tar.bz2
Merged core-8-5-branch
Diffstat (limited to 'tests')
-rw-r--r--tests/entry.test27
-rw-r--r--tests/spinbox.test22
2 files changed, 45 insertions, 4 deletions
diff --git a/tests/entry.test b/tests/entry.test
index 27acfc1..da3637d 100644
--- a/tests/entry.test
+++ b/tests/entry.test
@@ -1621,13 +1621,32 @@ 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!}]
+
+test entry-24.1 {textvariable lives in a non-existing namespace} {
+ destroy .e
+ catch {entry .e -textvariable thisnsdoesntexist::myvar} result1
+ set result1
+} {can't trace "thisnsdoesntexist::myvar": parent namespace doesn't exist}
+
destroy .e
# XXX Still need to write tests for EntryBlinkProc, EntryFocusProc,
diff --git a/tests/spinbox.test b/tests/spinbox.test
index 0661635..68c6fae 100644
--- a/tests/spinbox.test
+++ b/tests/spinbox.test
@@ -1583,6 +1583,28 @@ 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!}]
+
+test spinbox-25.1 {textvariable lives in a non-existing namespace} {
+ destroy .s
+ catch {spinbox .s -textvariable thisnsdoesntexist::myvar} result1
+ set result1
+} {can't trace "thisnsdoesntexist::myvar": parent namespace doesn't exist}
+
catch {unset ::e ::vVals}
##