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)
commit4e32aa71bd3505891bd5552b2847c036fe3a17f1 (patch)
treedd0fde4b21546c7e12721112864ceb79dbf0241e /tests/entry.test
parent490631b3dc5e62812bfd9d95b9afa8ee3e2f35d8 (diff)
downloadtk-4e32aa71bd3505891bd5552b2847c036fe3a17f1.zip
tk-4e32aa71bd3505891bd5552b2847c036fe3a17f1.tar.gz
tk-4e32aa71bd3505891bd5552b2847c036fe3a17f1.tar.bz2
Make tests pass again after fixing [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