diff options
Diffstat (limited to 'tests/unixSelect.test')
| -rw-r--r-- | tests/unixSelect.test | 142 |
1 files changed, 72 insertions, 70 deletions
diff --git a/tests/unixSelect.test b/tests/unixSelect.test index cb1908b..9fb40c9 100644 --- a/tests/unixSelect.test +++ b/tests/unixSelect.test @@ -14,6 +14,8 @@ namespace import ::tcltest::* tcltest::configure {*}$argv tcltest::loadTestedCommands +testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }] + global longValue selValue selInfo set selValue {} @@ -33,11 +35,11 @@ proc errIncrHandler {type offset count} { global selValue selInfo pass if {$offset == 4000} { if {$pass == 0} { - # Just sizing the selection; don't do anything here. - set pass 1 + # Just sizing the selection; don't do anything here. + set pass 1 } else { - # Fetching the selection; wait long enough to cause a timeout. - after 6000 + # Fetching the selection; wait long enough to cause a timeout. + after 6000 } } lappend selInfo $type $offset $count @@ -66,9 +68,9 @@ proc reallyBadHandler {path type offset count} { global selValue selInfo pass if {$offset == 4000} { if {$pass == 0} { - set pass 1 + set pass 1 } else { - selection handle -type $type $path {} + selection handle -type $type $path {} } } lappend selInfo $path $type $offset $count @@ -124,15 +126,15 @@ test unixSelect-1.1 {TkSelGetSelection procedure: simple i18n text} -constraints } -result 4 test unixSelect-1.2 {TkSelGetSelection procedure: simple i18n text, iso8859-1} -constraints { - x11 + x11 failsOnXQuarz } -setup { setupbg } -body { dobg { - pack [entry .e] - update - .e insert 0 üф - .e selection range 0 end + pack [entry .e] + update + .e insert 0 üф + .e selection range 0 end } selection get } -cleanup { @@ -146,13 +148,13 @@ test unixSelect-1.3 {TkSelGetSelection procedure: simple i18n text, iso2022} -co setup } -body { selection handle -type COMPOUND_TEXT -format COMPOUND_TEXT . \ - {handler COMPOUND_TEXT} + {handler COMPOUND_TEXT} selection own . set selValue üф set selInfo {} set result [dobg { - set x [selection get -type COMPOUND_TEXT] - list [string equal üф $x] [string length $x] + set x [selection get -type COMPOUND_TEXT] + list [string equal üф $x] [string length $x] }] lappend result $selInfo } -cleanup { @@ -170,15 +172,15 @@ test unixSelect-1.4 {TkSelGetSelection procedure: INCR i18n text, iso2022} -cons # The first time through, we don't convert the data to ISO2022, so the # buffer boundaries end up being different in the two passes. selection handle -type COMPOUND_TEXT -format COMPOUND_TEXT . \ - {handler COMPOUND_TEXT} + {handler COMPOUND_TEXT} selection own . set selValue [string repeat x 3999]üф[string repeat x 3999] set selInfo {} set result [dobg { - set x [selection get -type COMPOUND_TEXT] - list [string equal \ - [string repeat x 3999]üф[string repeat x 3999] $x] \ - [string length $x] + set x [selection get -type COMPOUND_TEXT] + list [string equal \ + [string repeat x 3999]üф[string repeat x 3999] $x] \ + [string length $x] }] lappend result $selInfo } -cleanup { @@ -192,13 +194,13 @@ test unixSelect-1.5 {TkSelGetSelection procedure: simple i18n text, iso2022} -co setup } -body { selection handle -type COMPOUND_TEXT -format COMPOUND_TEXT . \ - {handler COMPOUND_TEXT} + {handler COMPOUND_TEXT} selection own . set selValue üф set selInfo {} set result [dobg { - set x [selection get -type COMPOUND_TEXT] - list [string equal üф $x] [string length $x] + set x [selection get -type COMPOUND_TEXT] + list [string equal üф $x] [string length $x] }] lappend result $selInfo } -cleanup { @@ -224,10 +226,10 @@ test unixSelect-1.7 {TkSelGetSelection procedure: INCR i18n text} -constraints { setupbg } -body { dobg { - pack [entry .e] - update - .e insert 0 [string repeat x 3999]ü - .e selection range 0 end + pack [entry .e] + update + .e insert 0 [string repeat x 3999]ü + .e selection range 0 end } selection get } -cleanup { @@ -240,10 +242,10 @@ test unixSelect-1.8 {TkSelGetSelection procedure: INCR i18n text} -constraints { setupbg } -body { dobg { - pack [entry .e] - update - .e insert 0 ü[string repeat x 3999] - .e selection range 0 end + pack [entry .e] + update + .e insert 0 ü[string repeat x 3999] + .e selection range 0 end } selection get } -cleanup { @@ -256,10 +258,10 @@ test unixSelect-1.9 {TkSelGetSelection procedure: INCR i18n text} -constraints { setupbg } -body { dobg { - pack [entry .e] - update - .e insert 0 [string repeat x 3999]ü[string repeat x 4000] - .e selection range 0 end + pack [entry .e] + update + .e insert 0 [string repeat x 3999]ü[string repeat x 4000] + .e selection range 0 end } selection get } -cleanup { @@ -275,10 +277,10 @@ test unixSelect-1.10 {TkSelGetSelection procedure: INCR i18n text, utf-8} -const setupbg } -body { dobg { - pack [entry .e] - update - .e insert 0 [string repeat x 3999]ü - .e selection range 0 end + pack [entry .e] + update + .e insert 0 [string repeat x 3999]ü + .e selection range 0 end } selection get -type UTF8_STRING } -cleanup { @@ -291,10 +293,10 @@ test unixSelect-1.11 {TkSelGetSelection procedure: INCR i18n text, utf-8} -const setupbg } -body { dobg { - pack [entry .e] - update - .e insert 0 ü[string repeat x 3999] - .e selection range 0 end + pack [entry .e] + update + .e insert 0 ü[string repeat x 3999] + .e selection range 0 end } selection get -type UTF8_STRING } -cleanup { @@ -307,10 +309,10 @@ test unixSelect-1.12 {TkSelGetSelection procedure: INCR i18n text, utf-8} -const setupbg } -body { dobg { - pack [entry .e] - update - .e insert 0 [string repeat x 3999]ü[string repeat x 4000] - .e selection range 0 end + pack [entry .e] + update + .e insert 0 [string repeat x 3999]ü[string repeat x 4000] + .e selection range 0 end } selection get -type UTF8_STRING } -cleanup { @@ -318,7 +320,7 @@ test unixSelect-1.12 {TkSelGetSelection procedure: INCR i18n text, utf-8} -const } -result [string repeat x 3999]ü[string repeat x 4000] test unixSelect-1.13 {TkSelGetSelection procedure: simple i18n text, utf-8} -constraints { - x11 + x11 failsOnXQuarz } -setup { destroy .e setupbg @@ -334,15 +336,15 @@ test unixSelect-1.13 {TkSelGetSelection procedure: simple i18n text, utf-8} -con } -result 5 test unixSelect-1.14 {TkSelGetSelection procedure: simple i18n text, utf-8} -constraints { - x11 + x11 failsOnXQuarz } -setup { setupbg } -body { dobg { - pack [entry .e] - update - .e insert 0 üф - .e selection range 0 end + pack [entry .e] + update + .e insert 0 üф + .e selection range 0 end } selection get -type UTF8_STRING } -cleanup { @@ -355,10 +357,10 @@ test unixSelect-1.15 {TkSelGetSelection procedure: INCR i18n text, utf-8} -const setupbg } -body { dobg { - pack [entry .e] - update - .e insert 0 [string repeat [string repeat Ää 50]\n 21] - .e selection range 0 end + pack [entry .e] + update + .e insert 0 [string repeat [string repeat Ää 50]\n 21] + .e selection range 0 end } selection get -type UTF8_STRING } -cleanup { @@ -371,10 +373,10 @@ test unixSelect-1.16 {TkSelGetSelection procedure: INCR i18n text, utf-8} -const setupbg } -body { dobg { - pack [entry .e] - update - .e insert 0 i[string repeat [string repeat Ää 50]\n 21] - .e selection range 0 end + pack [entry .e] + update + .e insert 0 i[string repeat [string repeat Ää 50]\n 21] + .e selection range 0 end } selection get -type UTF8_STRING } -cleanup { @@ -387,11 +389,11 @@ test unixSelect-1.17 {TkSelGetSelection procedure: INCR i18n text, utf-8} -const setupbg } -body { dobg { - pack [text .t] - update - .t insert 1.0 [string repeat [string repeat Ää 50]\n 21] - # Has to be selected in a separate stage - .t tag add sel 1.0 21.end+1c + pack [text .t] + update + .t insert 1.0 [string repeat [string repeat Ää 50]\n 21] + # Has to be selected in a separate stage + .t tag add sel 1.0 21.end+1c } after 10 selection get -type UTF8_STRING @@ -405,11 +407,11 @@ test unixSelect-1.18 {TkSelGetSelection procedure: INCR i18n text, utf-8} -const setupbg } -body { dobg { - pack [text .t] - update - .t insert 1.0 i[string repeat [string repeat Ää 50]\n 21] - # Has to be selected in a separate stage - .t tag add sel 1.0 21.end+1c + pack [text .t] + update + .t insert 1.0 i[string repeat [string repeat Ää 50]\n 21] + # Has to be selected in a separate stage + .t tag add sel 1.0 21.end+1c } after 10 selection get -type UTF8_STRING |
