diff options
author | ericm <ericm> | 1999-11-18 01:47:07 (GMT) |
---|---|---|
committer | ericm <ericm> | 1999-11-18 01:47:07 (GMT) |
commit | 3c77fa79961cdc2712370cacb934e62364ed4a47 (patch) | |
tree | 7ec9b15187bdc4fdf4f50190620ae4127ea46ab7 /tests | |
parent | 0d1c77ca4797bd6bfc72ff240cee6e2476890944 (diff) | |
download | tk-3c77fa79961cdc2712370cacb934e62364ed4a47.zip tk-3c77fa79961cdc2712370cacb934e62364ed4a47.tar.gz tk-3c77fa79961cdc2712370cacb934e62364ed4a47.tar.bz2 |
* tests/listbox.test: Added tests for bad -listvar's.
* generic/tkListbox.c: Added handlers for bad -listvar's (ie, bad
lists)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/listbox.test | 21 |
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} |