os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/tests/set-old.test
Update contrib.
1 # Commands covered: set, unset, array
3 # This file includes the original set of tests for Tcl's set command.
4 # Since the set command is now compiled, a new set of tests covering
5 # the new implementation is in the file "set.test". Sourcing this file
6 # into Tcl runs the tests and generates output for errors.
7 # No output means no errors were found.
9 # Copyright (c) 1991-1993 The Regents of the University of California.
10 # Copyright (c) 1994-1997 Sun Microsystems, Inc.
11 # Copyright (c) 1998-1999 by Scriptics Corporation.
13 # See the file "license.terms" for information on usage and redistribution
14 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
16 # RCS: @(#) $Id: set-old.test,v 1.16.2.1 2003/03/27 21:46:32 msofer Exp $
18 if {[lsearch [namespace children] ::tcltest] == -1} {
19 package require tcltest
20 namespace import -force ::tcltest::*
25 # Simple variable operations.
28 test set-old-1.1 {basic variable setting and unsetting} {
31 test set-old-1.2 {basic variable setting and unsetting} {
35 test set-old-1.3 {basic variable setting and unsetting} {
39 test set-old-1.4 {basic variable setting and unsetting} {
42 list [catch {set a} msg] $msg
43 } {1 {can't read "a": no such variable}}
45 # Basic array operations.
50 set {a(a long name)} test
51 test set-old-2.1 {basic array operations} {
53 } {44 {a long name} xyz}
54 test set-old-2.2 {basic array operations} {
57 test set-old-2.3 {basic array operations} {
60 test set-old-2.4 {basic array operations} {
63 test set-old-2.5 {basic array operations} {
64 list [catch {set a(other)} msg] $msg
65 } {1 {can't read "a(other)": no such element in array}}
66 test set-old-2.6 {basic array operations} {
67 list [catch {set a} msg] $msg
68 } {1 {can't read "a": variable is array}}
69 test set-old-2.7 {basic array operations} {
72 test set-old-2.8 {basic array operations} {
73 format %s $a(a long name)
76 test set-old-2.9 {basic array operations} {
79 test set-old-2.10 {basic array operations} {
81 list [catch {set b(123)} msg] $msg
82 } {1 {can't read "b(123)": no such variable}}
83 test set-old-2.11 {basic array operations} {
86 list [catch {set b(123)} msg] $msg
87 } {1 {can't read "b(123)": variable isn't array}}
88 test set-old-2.12 {basic array operations} {
89 list [catch {set a 14} msg] $msg
90 } {1 {can't set "a": variable is array}}
92 test set-old-2.13 {basic array operations} {
93 list [catch {set a(xyz)} msg] $msg
94 } {1 {can't read "a(xyz)": no such variable}}
96 # Test the set commands, and exercise the corner cases of the code
97 # that parses array references into two parts.
99 test set-old-3.1 {set command} {
100 list [catch {set} msg] $msg
101 } {1 {wrong # args: should be "set varName ?newValue?"}}
102 test set-old-3.2 {set command} {
103 list [catch {set x y z} msg] $msg
104 } {1 {wrong # args: should be "set varName ?newValue?"}}
105 test set-old-3.3 {set command} {
107 list [catch {set a} msg] $msg
108 } {1 {can't read "a": no such variable}}
109 test set-old-3.4 {set command} {
112 list [catch {set a 22} msg] $msg
113 } {1 {can't set "a": variable is array}}
115 # Test the corner-cases of parsing array names, using set and unset.
117 test set-old-4.1 {parsing array names} {
120 list [catch {array names a} msg] $msg
122 test set-old-4.2 {parsing array names} {
123 catch {unset a a(abcd}
127 test set-old-4.3 {parsing array names} {
128 catch {unset a a(abcd}
130 list [catch {array names a} msg] $msg
132 test set-old-4.4 {parsing array names} {
133 catch {unset a abcd)}
137 test set-old-4.5 {parsing array names} {
140 list [catch {set a(bcd} msg] $msg
142 test set-old-4.6 {parsing array names} {
145 list [catch {set a(bcd test} msg] $msg
148 # Errors in reading variables
150 test set-old-5.1 {errors in reading variables} {
152 list [catch {set a} msg] $msg
153 } {1 {can't read "a": no such variable}}
154 test set-old-5.2 {errors in reading variables} {
157 list [catch {set a(18)} msg] $msg
158 } {1 {can't read "a(18)": variable isn't array}}
159 test set-old-5.3 {errors in reading variables} {
162 list [catch {set a(18)} msg] $msg
163 } {1 {can't read "a(18)": no such element in array}}
164 test set-old-5.4 {errors in reading variables} {
167 list [catch {set a} msg] $msg
168 } {1 {can't read "a": variable is array}}
170 # Errors and other special cases in writing variables
172 test set-old-6.1 {creating array during write} {
174 trace var a rwu ignore
175 list [catch {set a(14) 186} msg] $msg [array names a]
177 test set-old-6.2 {errors in writing variables} {
180 list [catch {set a(14) 186} msg] $msg
181 } {1 {can't set "a(14)": variable isn't array}}
182 test set-old-6.3 {errors in writing variables} {
185 list [catch {set a 2} msg] $msg
186 } {1 {can't set "a": variable is array}}
187 test set-old-6.4 {expanding variable size} {
189 list [set a short] [set a "longer name"] [set a "even longer name"] \
190 [set a "a much much truly longer name"]
191 } {short {longer name} {even longer name} {a much much truly longer name}}
193 # Unset command, Tcl_UnsetVar procedures
195 test set-old-7.1 {unset command} {
196 catch {unset a}; catch {unset b}; catch {unset c}; catch {unset d}
202 list [catch {set a(0) 0}] [catch {set b(0) 0}] [catch {set c(0) 0}] \
205 test set-old-7.2 {unset command} {
206 list [catch {unset} msg] $msg
209 #{1 {wrong # args: should be "unset ?-nocomplain? ?--? ?varName varName ...?"}}
210 test set-old-7.3 {unset command} {
212 list [catch {unset a} msg] $msg
213 } {1 {can't unset "a": no such variable}}
214 test set-old-7.4 {unset command} {
217 list [catch {unset a(14)} msg] $msg
218 } {1 {can't unset "a(14)": variable isn't array}}
219 test set-old-7.5 {unset command} {
222 list [catch {unset a(14)} msg] $msg
223 } {1 {can't unset "a(14)": no such element in array}}
224 test set-old-7.6 {unset command} {
225 catch {unset a}; catch {unset b}; catch {unset c}
228 list [catch {unset a a a(14)} msg] $msg [info exists c]
229 } {1 {can't unset "a": no such variable} 1}
230 test set-old-7.7 {unsetting globals from within procedures} {
235 return [list $z [catch {set y} msg] $msg]
237 proc p2 {} {global y; unset y; list [catch {set y} msg] $msg}
239 } {{1 {can't read "y": no such variable}} 1 {can't read "y": no such variable}}
240 test set-old-7.8 {unsetting globals from within procedures} {
245 return [list [catch {set y 44} msg] $msg]
247 proc p2 {} {global y; unset y}
248 concat [p1] [list [catch {set y} msg] $msg]
250 test set-old-7.9 {unsetting globals from within procedures} {
255 return [list [catch {set y 55} msg] $msg]
257 concat [p1] [list [catch {set y} msg] $msg]
259 test set-old-7.10 {unset command} {
263 list [catch {set a(14)} msg] $msg [catch {array names a} msg2] $msg2
264 } {1 {can't read "a(14)": no such element in array} 0 {}}
265 test set-old-7.11 {unset command} {
269 list [catch {set a(14)} msg] $msg [catch {array names a} msg2] $msg2
270 } {1 {can't read "a(14)": no such variable} 0 {}}
271 test set-old-7.12 {unset command, -nocomplain} {
273 list [info exists a] [catch {unset -nocomplain a}] [info exists a]
275 test set-old-7.13 {unset command, -nocomplain} {
277 list [info exists -nocomplain] [catch {unset -nocomplain}] \
278 [info exists -nocomplain] [catch {unset -- -nocomplain}] \
279 [info exists -nocomplain]
281 test set-old-7.14 {unset command, --} {
283 list [info exists --] [catch {unset --}] \
284 [info exists --] [catch {unset -- --}] \
287 test set-old-7.15 {unset command, -nocomplain} {
290 list [info exists -nocomplain] [catch {unset -- -nocomplain}] \
291 [info exists -nocomplain] [info exists --] \
292 [catch {unset -- -nocomplain}] [info exists --] \
293 [catch {unset -- --}] [info exists --]
295 test set-old-7.16 {unset command, -nocomplain} {
298 list [info exists bogus] [catch {unset -nocomplain bogus var bogus}] \
299 [info exists -nocomplain] [info exists var] \
300 [catch {unset -nocomplain -nocomplain}] [info exists -nocomplain]
302 test set-old-7.17 {unset command, -nocomplain (no abbreviation)} {
304 list [info exists -nocomp] [catch {unset -nocomp}] [info exists -nocomp]
306 test set-old-7.18 {unset command, -nocomplain (no abbreviation)} {
307 catch {unset -nocomp}
308 list [info exists -nocomp] [catch {unset -nocomp}]
313 test set-old-8.1 {array command} {
314 list [catch {array} msg] $msg
315 } {1 {wrong # args: should be "array option arrayName ?arg ...?"}}
316 test set-old-8.2 {array command} {
317 list [catch {array a} msg] $msg
318 } {1 {wrong # args: should be "array option arrayName ?arg ...?"}}
319 test set-old-8.3 {array command} {
321 list [catch {array anymore a b} msg] $msg
322 } {1 {"a" isn't an array}}
323 test set-old-8.4 {array command} {
326 list [catch {array anymore a b} msg] $msg
327 } {1 {"a" isn't an array}}
328 test set-old-8.5 {array command} {
332 list [catch {array anymore x b} msg] $msg
335 } {1 {"x" isn't an array}}
336 test set-old-8.6 {array command} {
339 list [catch {array gorp a} msg] $msg
340 } {1 {bad option "gorp": must be anymore, donesearch, exists, get, names, nextelement, set, size, startsearch, statistics, or unset}}
341 test set-old-8.7 {array command, anymore option} {
343 list [catch {array anymore a x} msg] $msg
344 } {1 {"a" isn't an array}}
345 test set-old-8.8 {array command, anymore option, array doesn't exist yet but has compiler-allocated procedure slot} {
348 return [array anymore a x]
352 list [catch {foo 1} msg] $msg
353 } {1 {"a" isn't an array}}
354 test set-old-8.9 {array command, donesearch option} {
356 list [catch {array donesearch a x} msg] $msg
357 } {1 {"a" isn't an array}}
358 test set-old-8.10 {array command, donesearch option, array doesn't exist yet but has compiler-allocated procedure slot} {
361 return [array donesearch a x]
365 list [catch {foo 1} msg] $msg
366 } {1 {"a" isn't an array}}
367 test set-old-8.11 {array command, exists option} {
368 list [catch {array exists a b} msg] $msg
369 } {1 {wrong # args: should be "array exists arrayName"}}
370 test set-old-8.12 {array command, exists option} {
374 test set-old-8.13 {array command, exists option} {
379 test set-old-8.14 {array command, exists option, array doesn't exist yet but has compiler-allocated procedure slot} {
382 return [array exists a]
386 list [catch {foo 1} msg] $msg
388 test set-old-8.15 {array command, get option} {
389 list [catch {array get} msg] $msg
390 } {1 {wrong # args: should be "array option arrayName ?arg ...?"}}
391 test set-old-8.16 {array command, get option} {
392 list [catch {array get a b c} msg] $msg
393 } {1 {wrong # args: should be "array get arrayName ?pattern?"}}
394 test set-old-8.17 {array command, get option} {
398 test set-old-8.18 {array command, get option} {
401 set {a(long name)} {}
403 } {{} 22 3 {long name}}
404 test set-old-8.19 {array command, get option (unset variable)} {
407 trace var a(y) w ignore
410 test set-old-8.20 {array command, get option, with pattern} {
417 lsort [array get a x*]
419 test set-old-8.21 {array command, get option, array doesn't exist yet but has compiler-allocated procedure slot} {
426 list [catch {foo 1} msg] $msg
428 test set-old-8.22 {array command, names option} {
431 list [catch {array names a 4 5} msg] $msg
432 } {1 {bad option "4": must be -exact, -glob, or -regexp}}
433 test set-old-8.23 {array command, names option} {
437 test set-old-8.24 {array command, names option} {
439 set a(22) 3; set a(Textual_name) 44; set "a(name with spaces)" xxx
440 list [catch {lsort [array names a]} msg] $msg
441 } {0 {22 Textual_name {name with spaces}}}
442 test set-old-8.25 {array command, names option} {
444 set a(22) 3; set a(33) 44;
445 trace var a(xxx) w ignore
446 list [catch {lsort [array names a]} msg] $msg
448 test set-old-8.26 {array command, names option} {
450 set a(22) 3; set a(33) 44;
451 trace var a(xxx) w ignore
453 list [catch {lsort [array names a]} msg] $msg
455 test set-old-8.27 {array command, names option} {
461 list [lsort [array names a *xy]] [lsort [array names a]]
462 } {{axy bxy} {axy bxy no xxx}}
463 test set-old-8.28 {array command, names option, array doesn't exist yet but has compiler-allocated procedure slot} {
466 return [array names a]
470 list [catch {foo 1} msg] $msg
472 test set-old-8.29 {array command, nextelement option} {
473 list [catch {array nextelement a} msg] $msg
474 } {1 {wrong # args: should be "array nextelement arrayName searchId"}}
475 test set-old-8.30 {array command, nextelement option} {
477 list [catch {array nextelement a b} msg] $msg
478 } {1 {"a" isn't an array}}
479 test set-old-8.31 {array command, nextelement option, array doesn't exist yet but has compiler-allocated procedure slot} {
482 return [array nextelement a b]
486 list [catch {foo 1} msg] $msg
487 } {1 {"a" isn't an array}}
488 test set-old-8.32 {array command, set option} {
489 list [catch {array set a} msg] $msg
490 } {1 {wrong # args: should be "array set arrayName list"}}
491 test set-old-8.33 {array command, set option} {
492 list [catch {array set a 1 2} msg] $msg
493 } {1 {wrong # args: should be "array set arrayName list"}}
494 test set-old-8.34 {array command, set option} {
495 list [catch {array set a "a \{ c"} msg] $msg
496 } {1 {unmatched open brace in list}}
497 test set-old-8.35 {array command, set option} {
500 list [catch {array set a {a b c d}} msg] $msg
501 } {1 {can't set "a(a)": variable isn't array}}
502 test set-old-8.36 {array command, set option} {
505 array set a {b c d e}
508 test set-old-8.37 {array command, set option, array doesn't exist yet but has compiler-allocated procedure slot} {
511 return [array set a {x 0}]
515 list [catch {foo 1} msg] $msg
517 test set-old-8.38 {array command, set option} {
518 catch {unset aVaRnAmE}
519 array set aVaRnAmE {}
520 list [info exists aVaRnAmE] [catch {set aVaRnAmE} msg] $msg
521 } {1 1 {can't read "aVaRnAmE": variable is array}}
522 test set-old-8.38.1 {array command, set scalar} {
523 catch {unset aVaRnAmE}
525 list [catch {array set aVaRnAmE {}} msg] $msg
526 } {1 {can't array set "aVaRnAmE": variable isn't array}}
527 test set-old-8.38.2 {array command, set alias} {
528 catch {unset aVaRnAmE}
529 upvar 0 aVaRnAmE anAliAs
531 list [array exists aVaRnAmE] [catch {set anAliAs} msg] $msg
532 } {1 1 {can't read "anAliAs": variable is array}}
533 test set-old-8.38.3 {array command, set element alias} {
534 catch {unset aVaRnAmE}
535 list [catch {upvar 0 aVaRnAmE(elem) elemAliAs}] \
536 [catch {array set elemAliAs {}} msg] $msg
537 } {0 1 {can't array set "elemAliAs": variable isn't array}}
538 test set-old-8.38.4 {array command, empty set with populated array} {
539 catch {unset aVaRnAmE}
540 array set aVaRnAmE [list e1 v1 e2 v2]
541 array set aVaRnAmE {}
542 array set aVaRnAmE [list e3 v3]
543 list [lsort [array names aVaRnAmE]] [catch {set aVaRnAmE(e2)} msg] $msg
545 test set-old-8.38.5 {array command, set with non-existent namespace} {
546 list [catch {array set bogusnamespace::var {}} msg] $msg
547 } {1 {can't set "bogusnamespace::var": parent namespace doesn't exist}}
548 test set-old-8.38.6 {array command, set with non-existent namespace} {
549 list [catch {array set bogusnamespace::var {a b}} msg] $msg
550 } {1 {can't set "bogusnamespace::var": parent namespace doesn't exist}}
551 test set-old-8.38.7 {array command, set with non-existent namespace} {
552 list [catch {array set bogusnamespace::var(0) {a b}} msg] $msg
553 } {1 {can't set "bogusnamespace::var(0)": variable isn't array}}
554 test set-old-8.39 {array command, size option} {
558 test set-old-8.40 {array command, size option} {
559 list [catch {array size a 4} msg] $msg
560 } {1 {wrong # args: should be "array size arrayName"}}
561 test set-old-8.41 {array command, size option} {
565 test set-old-8.42 {array command, size option} {
567 set a(22) 3; set a(Textual_name) 44; set "a(name with spaces)" xxx
568 list [catch {array size a} msg] $msg
570 test set-old-8.43 {array command, size option} {
572 set a(22) 3; set a(xx) 44; set a(y) xxx
573 unset a(22) a(y) a(xx)
574 list [catch {array size a} msg] $msg
576 test set-old-8.44 {array command, size option} {
579 trace var a(33) rwu ignore
580 list [catch {array size a} msg] $msg
582 test set-old-8.45 {array command, size option, array doesn't exist yet but has compiler-allocated procedure slot} {
585 return [array size a]
589 list [catch {foo 1} msg] $msg
591 test set-old-8.46 {array command, startsearch option} {
592 list [catch {array startsearch a b} msg] $msg
593 } {1 {wrong # args: should be "array startsearch arrayName"}}
594 test set-old-8.47 {array command, startsearch option} {
596 list [catch {array startsearch a} msg] $msg
597 } {1 {"a" isn't an array}}
598 test set-old-8.48 {array command, startsearch option, array doesn't exist yet but has compiler-allocated procedure slot} {
602 return [array startsearch a]
606 list [catch {p 1} msg] $msg
607 } {1 {"a" isn't an array}}
608 test set-old-8.49 {array command, statistics option} {
620 } "9 entries in table, 4 buckets
621 number of buckets with 0 entries: 0
622 number of buckets with 1 entries: 0
623 number of buckets with 2 entries: 3
624 number of buckets with 3 entries: 1
625 number of buckets with 4 entries: 0
626 number of buckets with 5 entries: 0
627 number of buckets with 6 entries: 0
628 number of buckets with 7 entries: 0
629 number of buckets with 8 entries: 0
630 number of buckets with 9 entries: 0
631 number of buckets with 10 or more entries: 0
632 average search distance for entry: 1.7"
633 test set-old-8.50 {array command, array names -exact on glob pattern} {
636 list [catch {array names a -exact 1*2} msg] $msg
638 test set-old-8.51 {array command, array names -glob on glob pattern} {
643 list [catch {lsort [array names a -glob 1*2]} msg] $msg
645 test set-old-8.52 {array command, array names -regexp on regexp pattern} {
650 list [catch {lsort [array names a -regexp ^1]} msg] $msg
652 test set-old-8.53 {array command, array names -regexp} {
657 list [catch {array names a -regexp} msg] $msg
659 test set-old-8.54 {array command, array names -exact} {
664 list [catch {array names a -exact} msg] $msg
666 test set-old-8.55 {array command, array names -glob} {
671 list [catch {array names a -glob} msg] $msg
673 test set-old-8.56 {array command, array statistics on a non-array} {
675 list [catch {array statistics a} msg] $msg
676 } [list 1 "\"a\" isn't an array"]
678 test set-old-9.1 {ids for array enumeration} {
681 list [array star a] [array star a] [array done a s-1-a; array star a] \
682 [array done a s-2-a; array d a s-3-a; array start a]
683 } {s-1-a s-2-a s-3-a s-1-a}
684 test set-old-9.2 {array enumeration} {
689 set x [array startsearch a]
690 lsort [list [array nextelement a $x] [array ne a $x] [array next a $x] \
691 [array next a $x] [array next a $x]]
693 test set-old-9.3 {array enumeration} {
698 set x [array startsearch a]
699 set y [array startsearch a]
700 set z [array startsearch a]
701 lsort [list [array nextelement a $x] [array ne a $x] \
702 [array next a $y] [array next a $z] [array next a $y] \
703 [array next a $z] [array next a $y] [array next a $z] \
704 [array next a $y] [array next a $z] [array next a $x] \
706 } {{} {} {} a a a b b b c c c}
707 test set-old-9.4 {array enumeration: stopping searches} {
712 set x [array startsearch a]
713 set y [array startsearch a]
714 set z [array startsearch a]
715 lsort [list [array next a $x] [array next a $x] [array next a $y] \
716 [array done a $z; array next a $x] \
717 [array done a $x; array next a $y] [array next a $y]]
719 test set-old-9.5 {array enumeration: stopping searches} {
722 set x [array startsearch a]
724 list [catch {array next a $x} msg] $msg
725 } {1 {couldn't find search "s-1-a"}}
726 test set-old-9.6 {array enumeration: searches automatically stopped} {
729 set x [array startsearch a]
730 set y [array startsearch a]
732 list [catch {array next a $x} msg] $msg \
733 [catch {array next a $y} msg2] $msg2
734 } {1 {couldn't find search "s-1-a"} 1 {couldn't find search "s-2-a"}}
735 test set-old-9.7 {array enumeration: searches automatically stopped} {
738 set x [array startsearch a]
739 set y [array startsearch a]
741 list [catch {array next a $x} msg] $msg \
742 [catch {array next a $y} msg2] $msg2
744 test set-old-9.8 {array enumeration: searches automatically stopped} {
748 set x [array startsearch a]
749 set y [array startsearch a]
751 list [catch {array next a $x} msg] $msg \
752 [catch {array next a $y} msg2] $msg2
753 } {1 {couldn't find search "s-1-a"} 1 {couldn't find search "s-2-a"}}
754 test set-old-9.9 {array enumeration: searches automatically stopped} {
757 set x [array startsearch a]
758 set y [array startsearch a]
760 list [catch {array next a $x} msg] $msg \
761 [catch {array next a $y} msg2] $msg2
763 test set-old-9.10 {array enumeration: searches automatically stopped} {
766 set x [array startsearch a]
767 set y [array startsearch a]
769 list [catch {array next a $x} msg] $msg \
770 [catch {array next a $y} msg2] $msg2
771 } {1 {couldn't find search "s-1-a"} 1 {couldn't find search "s-2-a"}}
772 test set-old-9.11 {array enumeration: searches automatically stopped} {
775 set x [array startsearch a]
776 set y [array startsearch a]
778 list [catch {array next a $x} msg] $msg \
779 [catch {array next a $y} msg2] $msg2
781 test set-old-9.12 {array enumeration with traced undefined elements} {
785 set x [array startsearch a]
786 lsort [list [array next a $x] [array next a $x]]
789 test set-old-10.1 {array enumeration errors} {
790 list [catch {array start} msg] $msg
791 } {1 {wrong # args: should be "array option arrayName ?arg ...?"}}
792 test set-old-10.2 {array enumeration errors} {
793 list [catch {array start a b} msg] $msg
794 } {1 {wrong # args: should be "array startsearch arrayName"}}
795 test set-old-10.3 {array enumeration errors} {
797 list [catch {array start a} msg] $msg
798 } {1 {"a" isn't an array}}
799 test set-old-10.4 {array enumeration errors} {
802 set x [array startsearch a]
803 list [catch {array next a} msg] $msg
804 } {1 {wrong # args: should be "array nextelement arrayName searchId"}}
805 test set-old-10.5 {array enumeration errors} {
808 set x [array startsearch a]
809 list [catch {array next a b c} msg] $msg
810 } {1 {wrong # args: should be "array nextelement arrayName searchId"}}
811 test set-old-10.6 {array enumeration errors} {
814 set x [array startsearch a]
815 list [catch {array next a a-1-a} msg] $msg
816 } {1 {illegal search identifier "a-1-a"}}
817 test set-old-10.7 {array enumeration errors} {
820 set x [array startsearch a]
821 list [catch {array next a sx1-a} msg] $msg
822 } {1 {illegal search identifier "sx1-a"}}
823 test set-old-10.8 {array enumeration errors} {
826 set x [array startsearch a]
827 list [catch {array next a s--a} msg] $msg
828 } {1 {illegal search identifier "s--a"}}
829 test set-old-10.9 {array enumeration errors} {
832 set x [array startsearch a]
833 list [catch {array next a s-1-b} msg] $msg
834 } {1 {search identifier "s-1-b" isn't for variable "a"}}
835 test set-old-10.10 {array enumeration errors} {
838 set x [array startsearch a]
839 list [catch {array next a s-1ba} msg] $msg
840 } {1 {illegal search identifier "s-1ba"}}
841 test set-old-10.11 {array enumeration errors} {
844 set x [array startsearch a]
845 list [catch {array next a s-2-a} msg] $msg
846 } {1 {couldn't find search "s-2-a"}}
847 test set-old-10.12 {array enumeration errors} {
848 list [catch {array done a} msg] $msg
849 } {1 {wrong # args: should be "array donesearch arrayName searchId"}}
850 test set-old-10.13 {array enumeration errors} {
851 list [catch {array done a b c} msg] $msg
852 } {1 {wrong # args: should be "array donesearch arrayName searchId"}}
853 test set-old-10.14 {array enumeration errors} {
854 list [catch {array done a b} msg] $msg
855 } {1 {illegal search identifier "b"}}
856 test set-old-10.15 {array enumeration errors} {
857 list [catch {array anymore a} msg] $msg
858 } {1 {wrong # args: should be "array anymore arrayName searchId"}}
859 test set-old-10.16 {array enumeration errors} {
860 list [catch {array any a b c} msg] $msg
861 } {1 {wrong # args: should be "array anymore arrayName searchId"}}
862 test set-old-10.17 {array enumeration errors} {
865 list [catch {array any a bogus} msg] $msg
866 } {1 {illegal search identifier "bogus"}}
868 # Array enumeration with "anymore" option
870 test set-old-11.1 {array anymore option} {
876 lsort [list [array anymore a s-1-a] [array next a s-1-a] \
877 [array anymore a s-1-a] [array next a s-1-a] \
878 [array anymore a s-1-a] [array next a s-1-a] \
879 [array anymore a s-1-a] [array next a s-1-a]]
881 test set-old-11.2 {array anymore option} {
887 lsort [list [array next a s-1-a] [array next a s-1-a] \
888 [array anymore a s-1-a] [array next a s-1-a] \
889 [array next a s-1-a] [array anymore a s-1-a]]
892 # Special check to see that the value of a variable is handled correctly
893 # if it is returned as the result of a procedure (must not free the variable
894 # string while deleting the call frame). Errors will only be detected if
895 # a memory consistency checker such as Purify is being used.
897 test set-old-12.1 {cleanup on procedure return} {
903 test set-old-12.2 {cleanup on procedure return} {
910 # Must delete variables when done, since these arrays get used as
911 # scalars by other tests.
915 catch {unset aVaRnAmE}
918 ::tcltest::cleanupTests