summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-02-26 01:07:29 (GMT)
committerhobbs <hobbs>2002-02-26 01:07:29 (GMT)
commit2a0c9c4e95668524eaab8994965f48277e478b9f (patch)
tree82b9e7b042c4d57578462a2f1861ee698ad37de7 /tests
parente717380ca7b1cb7e594f70095d9b94a2ff4badbc (diff)
downloadtk-2a0c9c4e95668524eaab8994965f48277e478b9f.zip
tk-2a0c9c4e95668524eaab8994965f48277e478b9f.tar.gz
tk-2a0c9c4e95668524eaab8994965f48277e478b9f.tar.bz2
* tests/listbox.test:
* generic/tkListbox.c: corrected error handling when setting to an invalid listvar value. [Bug #503613]
Diffstat (limited to 'tests')
-rw-r--r--tests/listbox.test22
1 files changed, 14 insertions, 8 deletions
diff --git a/tests/listbox.test b/tests/listbox.test
index acd4da3..0033ee4 100644
--- a/tests/listbox.test
+++ b/tests/listbox.test
@@ -6,7 +6,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: listbox.test,v 1.16 2001/09/01 00:51:11 hobbs Exp $
+# RCS: @(#) $Id: listbox.test,v 1.17 2002/02/26 01:07:29 hobbs Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
source [file join [pwd] [file dirname [info script]] defs.tcl]
@@ -940,11 +940,19 @@ test listbox-4.18 {ConfigureListbox, no listvar -> bad listvar} {
catch {destroy .l}
listbox .l
.l insert end a b c d
- set x {this is a " bad list}
+ set x "this is a \" bad list"
catch {.l configure -listvar x} result
list [.l get 0 end] [.l cget -listvar] $result
} [list [list a b c d] {} \
- "unmatched open quote in list: invalid listvar value"]
+ "unmatched open quote in list: invalid -listvariable value"]
+test listbox-4.19 {ConfigureListbox, no listvar -> bad non-existent listvar} {
+ catch {destroy .l}
+ listbox .l -listvar foo
+ .l insert end a b c d
+ catch {.l configure -listvar ::zoo::bar::foo} result
+ list [.l get 0 end] [.l cget -listvar] $foo $result
+} [list [list a b c d] foo [list a b c d] \
+ {can't set "::zoo::bar::foo": parent namespace doesn't exist}]
# No tests for DisplayListbox: I don't know how to test this procedure.
@@ -1848,7 +1856,7 @@ test listbox-21.11 {ListboxListVarProc, bad list} {
catch {unset x}
listbox .l -listvar x
set x [list a b c d]
- catch {set x {this is a " bad list}} result
+ catch {set x "this is a \" bad list"} result
set result
} {can't set "x": invalid listvar value}
test listbox-21.12 {ListboxListVarProc, cleanup item attributes} {
@@ -2100,10 +2108,6 @@ test listbox-26.5 {listbox disabled state disallows active modification} {
.l index active
} 0
-resetGridInfo
-eval destroy [winfo children .]
-option clear
-
test listbox-27.1 {widget deletion while active} {
destroy .l
pack [listbox .l]
@@ -2113,7 +2117,9 @@ test listbox-27.1 {widget deletion while active} {
winfo exists .l
} 0
+resetGridInfo
eval destroy [winfo children .]
+option clear
# cleanup
::tcltest::cleanupTests