summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorericm <ericm@noemail.net>1999-11-18 01:47:06 (GMT)
committerericm <ericm@noemail.net>1999-11-18 01:47:06 (GMT)
commit86080307df151ea24ce9b5696ffd2881ddbf7259 (patch)
tree7ec9b15187bdc4fdf4f50190620ae4127ea46ab7 /tests
parenta8e70f6c01d7af8a1f74ab5d6e65d427d3999dd0 (diff)
downloadtk-86080307df151ea24ce9b5696ffd2881ddbf7259.zip
tk-86080307df151ea24ce9b5696ffd2881ddbf7259.tar.gz
tk-86080307df151ea24ce9b5696ffd2881ddbf7259.tar.bz2
* tests/listbox.test: Added tests for bad -listvar's.
* generic/tkListbox.c: Added handlers for bad -listvar's (ie, bad lists) FossilOrigin-Name: a8241d6f0daec92b0050bf0d6f8aa538d7b41265
Diffstat (limited to 'tests')
-rw-r--r--tests/listbox.test21
1 files changed, 19 insertions, 2 deletions
diff --git a/tests/listbox.test b/tests/listbox.test
index d753251..5f3a683 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.6 1999/11/17 22:13:03 ericm Exp $
+# RCS: @(#) $Id: listbox.test,v 1.7 1999/11/18 01:47:08 ericm Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
source [file join [pwd] [file dirname [info script]] defs.tcl]
@@ -934,6 +934,15 @@ test listbox-4.17 {ConfigureListbox, no listvar -> no listvar} {
.l configure -listvar {}
.l get 0 end
} [list a b c d]
+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}
+ 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"]
+
# No tests for DisplayListbox: I don't know how to test this procedure.
test listbox-5.1 {ListboxComputeGeometry procedure} {fonts} {
@@ -1831,7 +1840,15 @@ test listbox-21.10 {ListboxListVarProc, test hscrollbar after listvar mod} {
update
set log
} [list {x 0 1} {x 0 1} {x 0 0.5} {x 0 1}]
-
+test listbox-21.11 {ListboxListVarProc, bad list} {
+ catch {destroy .l}
+ catch {unset x}
+ listbox .l -listvar x
+ set x [list a b c d]
+ set x {this is a " bad list}
+ set x
+} [list a b c d]
+
# UpdateHScrollbar
test listbox-22.1 {UpdateHScrollbar} {
catch {destroy .l}