summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2021-04-17 21:52:30 (GMT)
committerfvogel <fvogelnew1@free.fr>2021-04-17 21:52:30 (GMT)
commit5c6873217a6652c98e1919d47deb0da3a46b0ed4 (patch)
tree160360ca5c7d309256f4dbc04d495b4dd966214a /tests
parent4cac2bd3c4263102da89d22992df435f7ff410a6 (diff)
downloadtk-5c6873217a6652c98e1919d47deb0da3a46b0ed4.zip
tk-5c6873217a6652c98e1919d47deb0da3a46b0ed4.tar.gz
tk-5c6873217a6652c98e1919d47deb0da3a46b0ed4.tar.bz2
Fix [3540e4929cd]: Revised [text]: textDisp-17.10 fails. The tests of the TkTextScanCmd procedure combine xview, yview and scan commands, and typically check what is the resulting index @0,0. However, the text widget updates its view at idle time, and the tests shall take this fact into account, otherwise the results may be linked between tests. Especially textDisp-17.9 has wrong expected result (see also commit [bf453137e1]).
Diffstat (limited to 'tests')
-rw-r--r--tests/textDisp.test18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/textDisp.test b/tests/textDisp.test
index 935f4a9..ac80069 100644
--- a/tests/textDisp.test
+++ b/tests/textDisp.test
@@ -2352,45 +2352,61 @@ test textDisp-17.5 {TkTextScanCmd procedure} {
test textDisp-17.6 {TkTextScanCmd procedure} {textfonts} {
.t yview 1.0
.t xview moveto 0
+ updateText
.t scan mark 40 60
.t scan dragto 35 55
+ updateText
.t index @0,0
} {4.7}
test textDisp-17.7 {TkTextScanCmd procedure} {textfonts} {
.t yview 10.0
.t xview moveto 0
+ updateText
.t xview scroll 20 units
+ updateText
.t scan mark -10 60
.t scan dragto -5 65
+ updateText
.t index @0,0
set x [.t index @0,0]
.t scan dragto 0 [expr {70 + $fixedDiff}]
+ updateText
list $x [.t index @0,0]
} {6.12 2.5}
test textDisp-17.8 {TkTextScanCmd procedure} {textfonts} {
.t yview 1.0
.t xview moveto 0
+ updateText
.t scan mark 0 60
.t scan dragto 30 100
+ updateText
.t scan dragto 25 95
+ updateText
.t index @0,0
} {4.7}
test textDisp-17.9 {TkTextScanCmd procedure} {textfonts} {
.t yview end
.t xview moveto 0
+ updateText
.t xview scroll 100 units
+ updateText
.t scan mark 90 60
.t scan dragto 10 0
+ updateText
.t scan dragto 14 5
+ updateText
.t index @0,0
-} {18.44}
+} {14.44}
.t configure -wrap word
test textDisp-17.10 {TkTextScanCmd procedure, word wrapping} {textfonts} {
.t yview 10.0
+ updateText
.t scan mark -10 60
.t scan dragto -5 65
+ updateText
set x [.t index @0,0]
.t scan dragto 0 [expr {70 + $fixedDiff}]
+ updateText
list $x [.t index @0,0]
} {9.0 8.0}
.t configure -xscrollcommand scroll -yscrollcommand {}