summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorhobbs <hobbs@noemail.net>2000-08-05 23:53:09 (GMT)
committerhobbs <hobbs@noemail.net>2000-08-05 23:53:09 (GMT)
commitff69e70c52a09a4190b77592e31bce0657f394cb (patch)
tree7d003d614af5987da37517b22016022aec422d9d /tests
parent4d6f0eba5ba2db5a453bf5b05929a5826b154743 (diff)
downloadtk-ff69e70c52a09a4190b77592e31bce0657f394cb.zip
tk-ff69e70c52a09a4190b77592e31bce0657f394cb.tar.gz
tk-ff69e70c52a09a4190b77592e31bce0657f394cb.tar.bz2
* BACKPORTED FROM 8.4 (HEAD) BRANCH:
* tests/button.test: * generic/tkButton.c: Added -activeforeground, -activebackground for labels, for the -state option. * doc/label.n: Added -disabledforeground to list of options [Bug: 6053]. * tests/focus.test (focusSetupAlt): removed wm withdraw from proc as it would cause a hang for tkwait visibility * tests/menu.test: * generic/tk3d.c: * generic/tkColor.c: * generic/tkCursor.c: corrected handling of 3DBorder, Cursor and Color objects on multiple screens. [Bug: 5454] * generic/tkCursor.c: Added initialization for nextPtr field of TkCursor, patch from Nijtmans/Howlett. * canvas.test: added test for 5783. * generic/tkCanvPoly.c (DisplayPolygon): added checks for the polygon fillGC not being empty to prevent segfault. [Bug: 5783] * generic/tkImgGIF.c: Applied patch from Jan Nijtmans to fix a problem with the GIF writing code [Bug: 5823]. * generic/tkImgGIF.c: Changed defines for GIF87a/GIF89a to be static char arrays with integer initialization, to address EBCIDIC vs. ASCII encoding issues and to handle compilers that don't deal with "\xAB" syntax for specifying hex values in strings. * generic/tkMenu.c (DeleteMenuCloneEntries): Applied fix from [Bug: 5275], which corrected a segfault-causing indexing problem when deleting entries from torn-off menus. * generic/tkPlace.c (Tk_PlaceCmd): reworked place master/slave table init'n to prevent seg fault when using place on multiple displays. * tests/text.test: Added tests for -regexp -nocase searches with backslash character classes. * tests/text.test: Added tests for searching when text is elided. * generic/tkText.c (TextSearchCmd): Text search did not work properly when -regexp and -nocase were used, in combination with backslash character classes represented by capital letters (ie, \W, \M); altered implementation of -regexp -nocase searches to use new regexp interfaces to fix this problem. [Bug: 5988]. * generic/tkText.c (TextSearchCmd): Text search was not returning the correct index when the search covered (but did not search) elided characters; corrected this by adjusting the match index by the number of elided characters preceeding the start of the match, just as is done with embedded windows, etc. [Bug: 5470]. * generic/tkText.c (TextSearchCmd): Added a test for a NULL segment pointer when doing backwards searches for "" on an empty text widget. [Bug: 6007]. * library/focus.tcl: fixed calling of takeFocus proc [Bug: 5372] * win/tkWinMenu.c (ReconfigureWindowsMenu): Added MF_GRAYED bit for disabled menu entries, to ensure that those which are drawn by the system are shown grayed (such as entries on menubars) [Bug: 4372]. * win/tkWinMenu.c (ReconfigureWindowsMenu): Added code to add the MF_SEPARATOR bit for SEPARATOR_ENTRY menu items. This causes separator entries on the system menu to be drawn correctly [Bug: 5451]. * win/tkWinMenu.c (GetMenuSeparatorGeometry): Tweaked height requested for separator bars to be (linespace - (2*descent)) instead of just (linespace); this makes the separator occupy a more correct amount of vertical space. [Bug: 5303]. FossilOrigin-Name: f1303c4e2eb683e264aa4bf64ba8f88e63d960a4
Diffstat (limited to 'tests')
-rw-r--r--tests/button.test7
-rw-r--r--tests/canvas.test14
-rw-r--r--tests/focus.test3
-rw-r--r--tests/menu.test29
-rw-r--r--tests/text.test57
5 files changed, 85 insertions, 25 deletions
diff --git a/tests/button.test b/tests/button.test
index 58932bb..8ee8860 100644
--- a/tests/button.test
+++ b/tests/button.test
@@ -7,7 +7,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: button.test,v 1.5 2000/03/08 03:19:31 ericm Exp $
+# RCS: @(#) $Id: button.test,v 1.5.2.1 2000/08/05 23:53:13 hobbs Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
source [file join [pwd] [file dirname [info script]] defs.tcl]
@@ -51,9 +51,9 @@ update
set i 1
foreach test {
{-activebackground #012345 #012345 non-existent
- {unknown color name "non-existent"} {0 1 1 1}}
+ {unknown color name "non-existent"} {1 1 1 1}}
{-activeforeground #ff0000 #ff0000 non-existent
- {unknown color name "non-existent"} {0 1 1 1}}
+ {unknown color name "non-existent"} {1 1 1 1}}
{-anchor nw nw bogus {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center} {1 1 1 1}}
{-background #ff0000 #ff0000 non-existent
{unknown color name "non-existent"} {1 1 1 1}}
@@ -126,7 +126,6 @@ foreach test {
test button-1.$i {configuration options} {
.c configure -selectcolor {}
} {}
-incr i
test button-3.1 {ButtonCreate - not enough cd ../unix
} {
diff --git a/tests/canvas.test b/tests/canvas.test
index 86da456..df4d524 100644
--- a/tests/canvas.test
+++ b/tests/canvas.test
@@ -3,10 +3,10 @@
# standard fashion for Tcl tests.
#
# Copyright (c) 1995-1996 Sun Microsystems, Inc.
-# Copyright (c) 1998-1999 by Scriptics Corporation.
+# Copyright (c) 1998-2000 Ajuba Solutions.
# All rights reserved.
#
-# RCS: @(#) $Id: canvas.test,v 1.8 2000/03/29 00:09:06 ericm Exp $
+# RCS: @(#) $Id: canvas.test,v 1.8.2.1 2000/08/05 23:53:14 hobbs Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
source [file join [pwd] [file dirname [info script]] defs.tcl]
@@ -319,7 +319,7 @@ test canvas-10.7 {check errors from tag expressions} {
canvas .c
.c create oval 20 20 40 40 -fill red -tag [list a b c d]
.c create oval 20 260 40 280 -fill bisque -tag [list d "tag with spaces"]
- catch {.c find withtag {d&&"tag with spaces}} err
+ catch {.c find withtag "d&&\"tag with spaces"} err
set err
} {Missing endquote in tag search expression}
test canvas-10.8 {check errors from tag expressions} {
@@ -359,6 +359,14 @@ test canvas-10.12 {multple events bound to same tag expr} {
.c bind {a && b} <Leave> {puts Leave}
} {}
+test canvas-11.1 {canvas poly fill check, bug 5783} {
+ # This would crash in 8.3.0 and 8.3.1
+ destroy .c
+ pack [canvas .c]
+ .c create polygon 0 0 100 100 200 50 \
+ -fill {} -stipple gray50 -outline black
+} 1
+
# cleanup
::tcltest::cleanupTests
return
diff --git a/tests/focus.test b/tests/focus.test
index e8f850a..de6eda3 100644
--- a/tests/focus.test
+++ b/tests/focus.test
@@ -6,7 +6,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: focus.test,v 1.5 1999/04/16 01:51:37 stanton Exp $
+# RCS: @(#) $Id: focus.test,v 1.5.12.1 2000/08/05 23:53:14 hobbs Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
source [file join [pwd] [file dirname [info script]] defs.tcl]
@@ -33,7 +33,6 @@ proc focusSetupAlt {} {
global env
catch {destroy .alt}
toplevel .alt -screen $env(TK_ALT_DISPLAY)
- wm withdraw .alt
foreach i {a b c d} {
button .alt.$i -text .alt.$i -relief raised -bd 2
pack .alt.$i
diff --git a/tests/menu.test b/tests/menu.test
index 7b8ba02..e04ef3e 100644
--- a/tests/menu.test
+++ b/tests/menu.test
@@ -5,7 +5,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: menu.test,v 1.3 1999/04/16 01:51:39 stanton Exp $
+# RCS: @(#) $Id: menu.test,v 1.3.12.1 2000/08/05 23:53:14 hobbs Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
source [file join [pwd] [file dirname [info script]] defs.tcl]
@@ -2438,20 +2438,21 @@ test menu-33.1 {menu vs command hiding} {
# menu-34 MenuInit only called at boot time
+# creating menus on two different screens then deleting the
+# menu from the first screen crashes Tk8.3.1
+#
+test menu-35.1 {menus on multiple screens - crashes tk8.3.1, Bug 5454} {
+ if {[info exists ::env(TK_ALT_DISPLAY)]} {
+ toplevel .one
+ menu .one.m
+ toplevel .two -screen $::env(TK_ALT_DISPLAY)
+ menu .two.m
+ destroy .one
+ destroy .two
+ }
+} {}
+
# cleanup
deleteWindows
::tcltest::cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/text.test b/tests/text.test
index 651e7d8..e23b67e 100644
--- a/tests/text.test
+++ b/tests/text.test
@@ -6,7 +6,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: text.test,v 1.10 2000/02/03 17:29:58 ericm Exp $
+# RCS: @(#) $Id: text.test,v 1.10.2.1 2000/08/05 23:53:15 hobbs Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
source [file join [pwd] [file dirname [info script]] defs.tcl]
@@ -1110,7 +1110,60 @@ test text-20.65 {TextSearchCmd, unicode with non-text segments} {
set result
} {1.3 3}
-
+test text-20.66 {TextSearchCmd, hidden text does not affect match index} {
+ eval destroy [winfo child .]
+ pack [text .t2]
+ .t2 insert end "12345H7890"
+ .t2 search 7 1.0
+} 1.6
+test text-20.67 {TextSearchCmd, hidden text does not affect match index} {
+ eval destroy [winfo child .]
+ pack [text .t2]
+ .t2 insert end "12345H7890"
+ .t2 tag configure hidden -elide true
+ .t2 tag add hidden 1.5
+ .t2 search 7 1.0
+} 1.6
+test text-20.68 {TextSearchCmd, hidden text does not affect match index} {
+ eval destroy [winfo child .]
+ pack [text .t2]
+ .t2 insert end "foobar\nbarbaz\nbazboo"
+ .t2 search boo 1.0
+} 3.3
+test text-20.69 {TextSearchCmd, hidden text does not affect match index} {
+ eval destroy [winfo child .]
+ pack [text .t2]
+ .t2 insert end "foobar\nbarbaz\nbazboo"
+ .t2 tag configure hidden -elide true
+ .t2 tag add hidden 2.0 3.0
+ .t2 search boo 1.0
+} 3.3
+
+test text-20.70 {TextSearchCmd, -regexp -nocase searches} {
+ catch {destroy .t}
+ pack [text .t]
+ .t insert end "word1 word2"
+ set res [.t search -nocase -regexp {\mword.} 1.0 end]
+ destroy .t
+ set res
+} 1.0
+test text-20.71 {TextSearchCmd, -regexp -nocase searches} {
+ catch {destroy .t}
+ pack [text .t]
+ .t insert end "word1 word2"
+ set res [.t search -nocase -regexp {word.\M} 1.0 end]
+ destroy .t
+ set res
+} 1.0
+test text-20.72 {TextSearchCmd, -regexp -nocase searches} {
+ catch {destroy .t}
+ pack [text .t]
+ .t insert end "word1 word2"
+ set res [.t search -nocase -regexp {word.\W} 1.0 end]
+ destroy .t
+ set res
+} 1.0
+
eval destroy [winfo child .]
text .t2 -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 100
pack .t2