summaryrefslogtreecommitdiffstats
path: root/tests/entry.test
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2017-02-05 17:35:14 (GMT)
committerfvogel <fvogelnew1@free.fr>2017-02-05 17:35:14 (GMT)
commit3918cd0a0c0d1b541c8257ee8f29258e0fa8620f (patch)
treeaba5e420902f3e9764b952385ccec60f3441dadb /tests/entry.test
parent2f549b79aa4e7ec77cd00fcaf838205f3e3ad5ca (diff)
parent4e32aa71bd3505891bd5552b2847c036fe3a17f1 (diff)
downloadtk-3918cd0a0c0d1b541c8257ee8f29258e0fa8620f.zip
tk-3918cd0a0c0d1b541c8257ee8f29258e0fa8620f.tar.gz
tk-3918cd0a0c0d1b541c8257ee8f29258e0fa8620f.tar.bz2
Fix [c0dbdd3ff3]: Tk Compatibility Fonts block access to system fonts
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