diff options
author | dkf <dkf@noemail.net> | 2002-09-30 13:42:23 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2002-09-30 13:42:23 (GMT) |
commit | 359d0ea56889e5ae17864c234d285f275f0581d0 (patch) | |
tree | 124846f2dcff74b7175ff58e60340057201dd9f9 /tests/unixSelect.test | |
parent | 5dc03a86809803a86372985d6bda6ebec97f5a72 (diff) | |
download | tk-359d0ea56889e5ae17864c234d285f275f0581d0.zip tk-359d0ea56889e5ae17864c234d285f275f0581d0.tar.gz tk-359d0ea56889e5ae17864c234d285f275f0581d0.tar.bz2 |
Incremental transfers of UTF8_STRING selections should now work; Tk will now
tag them with the right size and only transfer complete UTF8 characters.
Previously, things only worked when the transfer could only happen in one go,
and even then not always. [Bug 614650, reported by Reinhard Max]
FossilOrigin-Name: bdabe5ef3614ee37392cac781fe4e52b7facfc3c
Diffstat (limited to 'tests/unixSelect.test')
-rw-r--r-- | tests/unixSelect.test | 65 |
1 files changed, 64 insertions, 1 deletions
diff --git a/tests/unixSelect.test b/tests/unixSelect.test index cc93902..7fe26bc 100644 --- a/tests/unixSelect.test +++ b/tests/unixSelect.test @@ -9,7 +9,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: unixSelect.test,v 1.4 2002/07/13 20:28:36 dgp Exp $ +# RCS: @(#) $Id: unixSelect.test,v 1.5 2002/09/30 13:42:25 dkf Exp $ package require tcltest 2.1 namespace import -force tcltest::configure @@ -233,6 +233,69 @@ test unixSelect-1.10 {TkSelGetSelection procedure: INCR i18n text} {unixOnly} { list [string equal [string repeat x 3999]\u00fc[string repeat x 4000] $x] \ [string length $x] [string bytelength $x] } {1 8000 8001} +# Now some tests to make sure that the right thing is done when +# transferring UTF8 selections, to prevent [Bug 614650] and its ilk +# from rearing its ugly head again. +test unixSelect-1.11 {TkSelGetSelection procedure: INCR i18n text, utf-8} {unixOnly} { + setupbg + dobg { + entry .e; pack .e; update + .e insert 0 [string repeat x 3999]\u00fc + .e selection range 0 end + } + set x [selection get -type UTF8_STRING] + cleanupbg + list [string equal [string repeat x 3999]\u00fc $x] \ + [string length $x] [string bytelength $x] +} {1 4000 4001} +test unixSelect-1.12 {TkSelGetSelection procedure: INCR i18n text, utf-8} {unixOnly} { + setupbg + dobg { + entry .e; pack .e; update + .e insert 0 \u00fc[string repeat x 3999] + .e selection range 0 end + } + set x [selection get -type UTF8_STRING] + cleanupbg + list [string equal \u00fc[string repeat x 3999] $x] \ + [string length $x] [string bytelength $x] +} {1 4000 4001} +test unixSelect-1.13 {TkSelGetSelection procedure: INCR i18n text, utf-8} {unixOnly} { + setupbg + dobg { + entry .e; pack .e; update + .e insert 0 [string repeat x 3999]\u00fc[string repeat x 4000] + .e selection range 0 end + } + set x [selection get -type UTF8_STRING] + cleanupbg + list [string equal [string repeat x 3999]\u00fc[string repeat x 4000] $x] \ + [string length $x] [string bytelength $x] +} {1 8000 8001} +test unixSelect-1.14 {TkSelGetSelection procedure: simple i18n text, utf-8} {unixOnly} { + setupbg + entry .e + pack .e + update + .e insert 0 [encoding convertfrom identity \u00fcber\u0444] + .e selection range 0 end + set result [dobg {string bytelength [selection get -type UTF8_STRING]}] + cleanupbg + destroy .e + set result +} {5} +test unixSelect-1.15 {TkSelGetSelection procedure: simple i18n text, utf-8} {unixOnly} { + setupbg + dobg { + entry .e; pack .e; update + .e insert 0 \u00fc\u0444 + .e selection range 0 end + } + set x [selection get -type UTF8_STRING] + cleanupbg + list [string equal \u00fc\u0444 $x] \ + [string length $x] [string bytelength $x] +} {1 2 4} # cleanup ::tcltest::cleanupTests |