summaryrefslogtreecommitdiffstats
path: root/tests/entry.test
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2017-01-28 17:38:11 (GMT)
committerfvogel <fvogelnew1@free.fr>2017-01-28 17:38:11 (GMT)
commitac3c1f125c104ab506961d6653f0de098a056686 (patch)
treedd0fde4b21546c7e12721112864ceb79dbf0241e /tests/entry.test
parentd033d601736ea26760f95cc30695c80d4d19bafe (diff)
downloadtk-bug_c0dbdd3ff3.zip
tk-bug_c0dbdd3ff3.tar.gz
tk-bug_c0dbdd3ff3.tar.bz2
Make tests pass again after fixing [c0dbdd3ff3]: Tk Compatibility Fonts block access to system fontsbug_c0dbdd3ff3
Diffstat (limited to 'tests/entry.test')
-rw-r--r--tests/entry.test18
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/entry.test b/tests/entry.test
index eeebe5d..785dd0b 100644
--- a/tests/entry.test
+++ b/tests/entry.test
@@ -2305,10 +2305,20 @@ test entry-8.18 {DeleteChars procedure} -setup {
.e insert 0 "xyzzy"
update
.e delete 2 4
- winfo reqwidth .e
-} -cleanup {
- destroy .e
-} -result {31}
+ # To check that deletion actually happened we measure the new width
+ # of the widget, based on the measuring width of the remaining text ("xyy")
+ # in the widget. For that purpose we have to mirror the code in tkEntry.c
+ # for computation of the reqwidth
+ # note: XPAD corresponds to the hardcoded #define XPAD 1
+ set XPAD 1
+ set expected [expr { [font measure [.e cget -font] "xyy"] \
+ + 2 * ( [.e cget -borderwidth] + \
+ [.e cget -highlightthickness] + $XPAD ) } ]
+ expr {[winfo reqwidth .e] == $expected}
+} -cleanup {
+ destroy .e
+ unset XPAD expected
+} -result {1}
test entry-9.1 {EntryValueChanged procedure} -setup {
unset -nocomplain x