In core-8-5-branch, on Windows Vista, test textTag-15.1 fails when it is executed after test text-36.* in a combined run.
To demonstrate the issue, run the entire test suite of Tk, or just the tests such that "-file text*.test", or more minimally:
set MYTCL="<path>\tcltk-fossil\tcl-fossil"
set MYTK="<path>\tcltk-fossil\tk-fossil"
cd %MYTK%\win
nmake -f makefile.vc test OPTS=symbols TCLDIR=%MYTCL% TESTFLAGS="-file text{,Tag}.test"
This will run the tests from files text.test and testTag.test in turn, and only those from these files, in the local fossil repositories.
Then you get the failure:
==== textTag-15.1 TkTextBindProc FAILED
==== Contents of test case:
bind .t <ButtonRelease> {lappend x up}
.t tag bind x <ButtonRelease> {lappend x x-up}
.t tag bind y <ButtonRelease> {lappend x y-up}
set x {}
.t tag add x 2.0 2.4
.t tag add y 4.3
event gen .t <Button> -x $x1 -y $y1
event gen .t <Motion> -x $x1 -y $y1
event gen .t <ButtonRelease> -x $x1 -y $y1
event gen .t <Button> -x $x1 -y $y1
event gen .t <Motion> -x $x2 -y $y2
event gen .t <ButtonRelease> -x $x2 -y $y2
event gen .t <Button> -x $x2 -y $y2
event gen .t <Motion> -x $x3 -y $y3
event gen .t <ButtonRelease> -x $x3 -y $y3
bind .t <ButtonRelease> {}
set x
---- Result was:
up up up
---- Result should have been (exact matching):
x-up up up y-up up
==== textTag-15.1 FAILED
Running textTag.test alone does not trigger the problem: textTag-15.1 passes in this case.
The problem shows up however when text.test is run before textTag.test.
Trimming down:
- not running just text-36.1 (nor 36-2 nor 36-3) makes textTag-15.1 pass
- the issue is then in the interaction between those tests when run all in a row
Further narrowing down, I've come up with the following script to demonstrate the problem:
pack [text .t1]
event generate .t1 <1>
destroy .t1
pack [text .t -width 20 -height 10]
.t insert 1.0 "Line 1"
update
set c [.t bbox 1.1]
set x1 [expr [lindex $c 0] + [lindex $c 2]/2]
set y1 [expr [lindex $c 1] + [lindex $c 3]/2]
bind .t <ButtonRelease> {lappend x up}
.t tag bind x <ButtonRelease> {lappend x x-up}
set x {}
.t tag add x 1.0 1.4
event generate .t <Button> -x $x1 -y $y1
event generate .t <Motion> -x $x1 -y $y1
event generate .t <ButtonRelease> -x $x1 -y $y1
set x
# x-up up is expected, however most of the time (but not always) simply
# up is output, which is wrong
destroy .t
This script seems to be minimal.
To show the issue, launch wish, and paste the script in in at once. The output should be:
x-up up
but is is:
up
most of the time, although not always!
The trimmed test case above demonstrates the problem at least in 8.5 from core-8-5-branch, or core-8-4-branch, or 8.5.9 precompiled binaries from Activestate.
I could not reproduce the problem in trunk so far.
Clueless...
Reproduced on Ubuntu 12.04 LTS Precise Pangolin, with Tcl/Tk 8.5.11.