sl@0
|
1 |
# Commands covered: lsearch
|
sl@0
|
2 |
#
|
sl@0
|
3 |
# This file contains a collection of tests for one or more of the Tcl
|
sl@0
|
4 |
# built-in commands. Sourcing this file into Tcl runs the tests and
|
sl@0
|
5 |
# generates output for errors. No output means no errors were found.
|
sl@0
|
6 |
#
|
sl@0
|
7 |
# Copyright (c) 1991-1993 The Regents of the University of California.
|
sl@0
|
8 |
# Copyright (c) 1994 Sun Microsystems, Inc.
|
sl@0
|
9 |
# Copyright (c) 1998-1999 by Scriptics Corporation.
|
sl@0
|
10 |
#
|
sl@0
|
11 |
# See the file "license.terms" for information on usage and redistribution
|
sl@0
|
12 |
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
sl@0
|
13 |
#
|
sl@0
|
14 |
# RCS: @(#) $Id: lsearch.test,v 1.10.2.3 2005/12/09 14:39:25 dkf Exp $
|
sl@0
|
15 |
|
sl@0
|
16 |
if {[lsearch [namespace children] ::tcltest] == -1} {
|
sl@0
|
17 |
package require tcltest
|
sl@0
|
18 |
namespace import -force ::tcltest::*
|
sl@0
|
19 |
}
|
sl@0
|
20 |
|
sl@0
|
21 |
set x {abcd bbcd 123 234 345}
|
sl@0
|
22 |
test lsearch-1.1 {lsearch command} {
|
sl@0
|
23 |
lsearch $x 123
|
sl@0
|
24 |
} 2
|
sl@0
|
25 |
test lsearch-1.2 {lsearch command} {
|
sl@0
|
26 |
lsearch $x 3456
|
sl@0
|
27 |
} -1
|
sl@0
|
28 |
test lsearch-1.3 {lsearch command} {
|
sl@0
|
29 |
lsearch $x *5
|
sl@0
|
30 |
} 4
|
sl@0
|
31 |
test lsearch-1.4 {lsearch command} {
|
sl@0
|
32 |
lsearch $x *bc*
|
sl@0
|
33 |
} 0
|
sl@0
|
34 |
|
sl@0
|
35 |
test lsearch-2.1 {search modes} {
|
sl@0
|
36 |
lsearch -exact {xyz bbcc *bc*} *bc*
|
sl@0
|
37 |
} 2
|
sl@0
|
38 |
test lsearch-2.2 {search modes} {
|
sl@0
|
39 |
lsearch -exact {b.x ^bc xy bcx} ^bc
|
sl@0
|
40 |
} 1
|
sl@0
|
41 |
test lsearch-2.3 {search modes} {
|
sl@0
|
42 |
lsearch -exact {foo bar cat} ba
|
sl@0
|
43 |
} -1
|
sl@0
|
44 |
test lsearch-2.4 {search modes} {
|
sl@0
|
45 |
lsearch -exact {foo bar cat} bart
|
sl@0
|
46 |
} -1
|
sl@0
|
47 |
test lsearch-2.5 {search modes} {
|
sl@0
|
48 |
lsearch -exact {foo bar cat} bar
|
sl@0
|
49 |
} 1
|
sl@0
|
50 |
test lsearch-2.6 {search modes} {
|
sl@0
|
51 |
list [catch {lsearch -regexp {xyz bbcc *bc*} *bc*} msg] $msg
|
sl@0
|
52 |
} {1 {couldn't compile regular expression pattern: quantifier operand invalid}}
|
sl@0
|
53 |
test lsearch-2.7 {search modes} {
|
sl@0
|
54 |
lsearch -regexp {b.x ^bc xy bcx} ^bc
|
sl@0
|
55 |
} 3
|
sl@0
|
56 |
test lsearch-2.8 {search modes} {
|
sl@0
|
57 |
lsearch -glob {xyz bbcc *bc*} *bc*
|
sl@0
|
58 |
} 1
|
sl@0
|
59 |
test lsearch-2.9 {search modes} {
|
sl@0
|
60 |
lsearch -glob {b.x ^bc xy bcx} ^bc
|
sl@0
|
61 |
} 1
|
sl@0
|
62 |
test lsearch-2.10 {search modes} {
|
sl@0
|
63 |
list [catch {lsearch -glib {b.x bx xy bcx} b.x} msg] $msg
|
sl@0
|
64 |
} {1 {bad option "-glib": must be -all, -ascii, -decreasing, -dictionary, -exact, -glob, -increasing, -inline, -integer, -not, -real, -regexp, -sorted, or -start}}
|
sl@0
|
65 |
|
sl@0
|
66 |
test lsearch-3.1 {lsearch errors} {
|
sl@0
|
67 |
list [catch lsearch msg] $msg
|
sl@0
|
68 |
} {1 {wrong # args: should be "lsearch ?options? list pattern"}}
|
sl@0
|
69 |
test lsearch-3.2 {lsearch errors} {
|
sl@0
|
70 |
list [catch {lsearch a} msg] $msg
|
sl@0
|
71 |
} {1 {wrong # args: should be "lsearch ?options? list pattern"}}
|
sl@0
|
72 |
test lsearch-3.3 {lsearch errors} {
|
sl@0
|
73 |
list [catch {lsearch a b c} msg] $msg
|
sl@0
|
74 |
} {1 {bad option "a": must be -all, -ascii, -decreasing, -dictionary, -exact, -glob, -increasing, -inline, -integer, -not, -real, -regexp, -sorted, or -start}}
|
sl@0
|
75 |
test lsearch-3.4 {lsearch errors} {
|
sl@0
|
76 |
list [catch {lsearch a b c d} msg] $msg
|
sl@0
|
77 |
} {1 {bad option "a": must be -all, -ascii, -decreasing, -dictionary, -exact, -glob, -increasing, -inline, -integer, -not, -real, -regexp, -sorted, or -start}}
|
sl@0
|
78 |
test lsearch-3.5 {lsearch errors} {
|
sl@0
|
79 |
list [catch {lsearch "\{" b} msg] $msg
|
sl@0
|
80 |
} {1 {unmatched open brace in list}}
|
sl@0
|
81 |
|
sl@0
|
82 |
test lsearch-4.1 {binary data} {
|
sl@0
|
83 |
lsearch -exact [list foo one\000two bar] bar
|
sl@0
|
84 |
} 2
|
sl@0
|
85 |
test lsearch-4.2 {binary data} {
|
sl@0
|
86 |
set x one
|
sl@0
|
87 |
append x \x00
|
sl@0
|
88 |
append x two
|
sl@0
|
89 |
lsearch -exact [list foo one\000two bar] $x
|
sl@0
|
90 |
} 1
|
sl@0
|
91 |
|
sl@0
|
92 |
# Make a sorted list
|
sl@0
|
93 |
set l {}
|
sl@0
|
94 |
set l2 {}
|
sl@0
|
95 |
for {set i 0} {$i < 100} {incr i} {
|
sl@0
|
96 |
lappend l $i
|
sl@0
|
97 |
lappend l2 [expr {double($i)/2}]
|
sl@0
|
98 |
}
|
sl@0
|
99 |
set increasingIntegers [lsort -integer $l]
|
sl@0
|
100 |
set decreasingIntegers [lsort -decreasing -integer $l]
|
sl@0
|
101 |
set increasingDoubles [lsort -real $l2]
|
sl@0
|
102 |
set decreasingDoubles [lsort -decreasing -real $l2]
|
sl@0
|
103 |
set increasingStrings [lsort {48 6a 18b 22a 21aa 35 36}]
|
sl@0
|
104 |
set decreasingStrings [lsort -decreasing {48 6a 18b 22a 21aa 35 36}]
|
sl@0
|
105 |
set increasingDictionary [lsort -dictionary {48 6a 18b 22a 21aa 35 36}]
|
sl@0
|
106 |
set decreasingDictionary [lsort -dictionary -decreasing $increasingDictionary]
|
sl@0
|
107 |
|
sl@0
|
108 |
set l {}
|
sl@0
|
109 |
for {set i 0} {$i < 10} {incr i} {
|
sl@0
|
110 |
lappend l $i $i $i $i $i
|
sl@0
|
111 |
}
|
sl@0
|
112 |
set repeatingIncreasingIntegers [lsort -integer $l]
|
sl@0
|
113 |
set repeatingDecreasingIntegers [lsort -integer -decreasing $l]
|
sl@0
|
114 |
|
sl@0
|
115 |
test lsearch-5.1 {binary search} {
|
sl@0
|
116 |
set res {}
|
sl@0
|
117 |
for {set i 0} {$i < 100} {incr i} {
|
sl@0
|
118 |
lappend res [lsearch -integer -sorted $increasingIntegers $i]
|
sl@0
|
119 |
}
|
sl@0
|
120 |
set res
|
sl@0
|
121 |
} $increasingIntegers
|
sl@0
|
122 |
test lsearch-5.2 {binary search} {
|
sl@0
|
123 |
set res {}
|
sl@0
|
124 |
for {set i 0} {$i < 100} {incr i} {
|
sl@0
|
125 |
lappend res [lsearch -integer -decreasing -sorted \
|
sl@0
|
126 |
$decreasingIntegers $i]
|
sl@0
|
127 |
}
|
sl@0
|
128 |
set res
|
sl@0
|
129 |
} $decreasingIntegers
|
sl@0
|
130 |
test lsearch-5.3 {binary search finds leftmost occurances} {
|
sl@0
|
131 |
set res {}
|
sl@0
|
132 |
for {set i 0} {$i < 10} {incr i} {
|
sl@0
|
133 |
lappend res [lsearch -integer -sorted $repeatingIncreasingIntegers $i]
|
sl@0
|
134 |
}
|
sl@0
|
135 |
set res
|
sl@0
|
136 |
} [list 0 5 10 15 20 25 30 35 40 45]
|
sl@0
|
137 |
test lsearch-5.4 {binary search -decreasing finds leftmost occurances} {
|
sl@0
|
138 |
set res {}
|
sl@0
|
139 |
for {set i 9} {$i >= 0} {incr i -1} {
|
sl@0
|
140 |
lappend res [lsearch -sorted -integer -decreasing \
|
sl@0
|
141 |
$repeatingDecreasingIntegers $i]
|
sl@0
|
142 |
}
|
sl@0
|
143 |
set res
|
sl@0
|
144 |
} [list 0 5 10 15 20 25 30 35 40 45]
|
sl@0
|
145 |
|
sl@0
|
146 |
test lsearch-6.1 {integer search} {
|
sl@0
|
147 |
set res {}
|
sl@0
|
148 |
for {set i 0} {$i < 100} {incr i} {
|
sl@0
|
149 |
lappend res [lsearch -exact -integer $increasingIntegers $i]
|
sl@0
|
150 |
}
|
sl@0
|
151 |
set res
|
sl@0
|
152 |
} [lrange $increasingIntegers 0 99]
|
sl@0
|
153 |
test lsearch-6.2 {decreasing integer search} {
|
sl@0
|
154 |
set res {}
|
sl@0
|
155 |
for {set i 0} {$i < 100} {incr i} {
|
sl@0
|
156 |
lappend res [lsearch -exact -integer -decreasing \
|
sl@0
|
157 |
$decreasingIntegers $i]
|
sl@0
|
158 |
}
|
sl@0
|
159 |
set res
|
sl@0
|
160 |
} [lrange $decreasingIntegers 0 99]
|
sl@0
|
161 |
test lsearch-6.3 {sorted integer search} {
|
sl@0
|
162 |
set res {}
|
sl@0
|
163 |
for {set i 0} {$i < 100} {incr i} {
|
sl@0
|
164 |
lappend res [lsearch -sorted -integer $increasingIntegers $i]
|
sl@0
|
165 |
}
|
sl@0
|
166 |
set res
|
sl@0
|
167 |
} [lrange $increasingIntegers 0 99]
|
sl@0
|
168 |
test lsearch-6.4 {sorted decreasing integer search} {
|
sl@0
|
169 |
set res {}
|
sl@0
|
170 |
for {set i 0} {$i < 100} {incr i} {
|
sl@0
|
171 |
lappend res [lsearch -integer -sorted -decreasing \
|
sl@0
|
172 |
$decreasingIntegers $i]
|
sl@0
|
173 |
}
|
sl@0
|
174 |
set res
|
sl@0
|
175 |
} [lrange $decreasingIntegers 0 99]
|
sl@0
|
176 |
|
sl@0
|
177 |
test lsearch-7.1 {double search} {
|
sl@0
|
178 |
set res {}
|
sl@0
|
179 |
for {set i 0} {$i < 100} {incr i} {
|
sl@0
|
180 |
lappend res [lsearch -exact -real $increasingDoubles \
|
sl@0
|
181 |
[expr {double($i)/2}]]
|
sl@0
|
182 |
}
|
sl@0
|
183 |
set res
|
sl@0
|
184 |
} [lrange $increasingIntegers 0 99]
|
sl@0
|
185 |
test lsearch-7.2 {decreasing double search} {
|
sl@0
|
186 |
set res {}
|
sl@0
|
187 |
for {set i 0} {$i < 100} {incr i} {
|
sl@0
|
188 |
lappend res [lsearch -exact -real -decreasing \
|
sl@0
|
189 |
$decreasingDoubles [expr {double($i)/2}]]
|
sl@0
|
190 |
}
|
sl@0
|
191 |
set res
|
sl@0
|
192 |
} [lrange $decreasingIntegers 0 99]
|
sl@0
|
193 |
test lsearch-7.3 {sorted double search} {
|
sl@0
|
194 |
set res {}
|
sl@0
|
195 |
for {set i 0} {$i < 100} {incr i} {
|
sl@0
|
196 |
lappend res [lsearch -sorted -real \
|
sl@0
|
197 |
$increasingDoubles [expr {double($i)/2}]]
|
sl@0
|
198 |
}
|
sl@0
|
199 |
set res
|
sl@0
|
200 |
} [lrange $increasingIntegers 0 99]
|
sl@0
|
201 |
test lsearch-7.4 {sorted decreasing double search} {
|
sl@0
|
202 |
set res {}
|
sl@0
|
203 |
for {set i 0} {$i < 100} {incr i} {
|
sl@0
|
204 |
lappend res [lsearch -sorted -real -decreasing \
|
sl@0
|
205 |
$decreasingDoubles [expr {double($i)/2}]]
|
sl@0
|
206 |
}
|
sl@0
|
207 |
set res
|
sl@0
|
208 |
} [lrange $decreasingIntegers 0 99]
|
sl@0
|
209 |
|
sl@0
|
210 |
test lsearch-8.1 {dictionary search} {
|
sl@0
|
211 |
set res {}
|
sl@0
|
212 |
foreach val {6a 18b 21aa 22a 35 36 48} {
|
sl@0
|
213 |
lappend res [lsearch -exact -dictionary $increasingDictionary $val]
|
sl@0
|
214 |
}
|
sl@0
|
215 |
set res
|
sl@0
|
216 |
} [list 0 1 2 3 4 5 6]
|
sl@0
|
217 |
test lsearch-8.2 {decreasing dictionary search} {
|
sl@0
|
218 |
set res {}
|
sl@0
|
219 |
foreach val {6a 18b 21aa 22a 35 36 48} {
|
sl@0
|
220 |
lappend res [lsearch -exact -dictionary $decreasingDictionary $val]
|
sl@0
|
221 |
}
|
sl@0
|
222 |
set res
|
sl@0
|
223 |
} [list 6 5 4 3 2 1 0]
|
sl@0
|
224 |
test lsearch-8.3 {sorted dictionary search} {
|
sl@0
|
225 |
set res {}
|
sl@0
|
226 |
foreach val {6a 18b 21aa 22a 35 36 48} {
|
sl@0
|
227 |
lappend res [lsearch -sorted -dictionary $increasingDictionary $val]
|
sl@0
|
228 |
}
|
sl@0
|
229 |
set res
|
sl@0
|
230 |
} [list 0 1 2 3 4 5 6]
|
sl@0
|
231 |
test lsearch-8.4 {decreasing sorted dictionary search} {
|
sl@0
|
232 |
set res {}
|
sl@0
|
233 |
foreach val {6a 18b 21aa 22a 35 36 48} {
|
sl@0
|
234 |
lappend res [lsearch -decreasing -sorted -dictionary \
|
sl@0
|
235 |
$decreasingDictionary $val]
|
sl@0
|
236 |
}
|
sl@0
|
237 |
set res
|
sl@0
|
238 |
} [list 6 5 4 3 2 1 0]
|
sl@0
|
239 |
|
sl@0
|
240 |
test lsearch-9.1 {ascii search} {
|
sl@0
|
241 |
set res {}
|
sl@0
|
242 |
foreach val {18b 21aa 22a 35 36 48 6a} {
|
sl@0
|
243 |
lappend res [lsearch -exact -ascii $increasingStrings $val]
|
sl@0
|
244 |
}
|
sl@0
|
245 |
set res
|
sl@0
|
246 |
} [list 0 1 2 3 4 5 6]
|
sl@0
|
247 |
test lsearch-9.2 {decreasing ascii search} {
|
sl@0
|
248 |
set res {}
|
sl@0
|
249 |
foreach val {18b 21aa 22a 35 36 48 6a} {
|
sl@0
|
250 |
lappend res [lsearch -exact -ascii $decreasingStrings $val]
|
sl@0
|
251 |
}
|
sl@0
|
252 |
set res
|
sl@0
|
253 |
} [list 6 5 4 3 2 1 0]
|
sl@0
|
254 |
test lsearch-9.3 {sorted ascii search} {
|
sl@0
|
255 |
set res {}
|
sl@0
|
256 |
foreach val {18b 21aa 22a 35 36 48 6a} {
|
sl@0
|
257 |
lappend res [lsearch -sorted -ascii $increasingStrings $val]
|
sl@0
|
258 |
}
|
sl@0
|
259 |
set res
|
sl@0
|
260 |
} [list 0 1 2 3 4 5 6]
|
sl@0
|
261 |
test lsearch-9.4 {decreasing sorted ascii search} {
|
sl@0
|
262 |
set res {}
|
sl@0
|
263 |
foreach val {18b 21aa 22a 35 36 48 6a} {
|
sl@0
|
264 |
lappend res [lsearch -decreasing -sorted -ascii \
|
sl@0
|
265 |
$decreasingStrings $val]
|
sl@0
|
266 |
}
|
sl@0
|
267 |
set res
|
sl@0
|
268 |
} [list 6 5 4 3 2 1 0]
|
sl@0
|
269 |
|
sl@0
|
270 |
test lsearch-10.1 {offset searching} {
|
sl@0
|
271 |
lsearch -start 2 {a b c a b c} a
|
sl@0
|
272 |
} 3
|
sl@0
|
273 |
test lsearch-10.2 {offset searching} {
|
sl@0
|
274 |
lsearch -start 2 {a b c d e f} a
|
sl@0
|
275 |
} -1
|
sl@0
|
276 |
test lsearch-10.3 {offset searching} {
|
sl@0
|
277 |
lsearch -start end-4 {a b c a b c} a
|
sl@0
|
278 |
} 3
|
sl@0
|
279 |
test lsearch-10.4 {offset searching} {
|
sl@0
|
280 |
list [catch {lsearch -start foobar {a b c a b c} a} msg] $msg
|
sl@0
|
281 |
} {1 {bad index "foobar": must be integer or end?-integer?}}
|
sl@0
|
282 |
test lsearch-10.5 {offset searching} {
|
sl@0
|
283 |
list [catch {lsearch -start 1 2} msg] $msg
|
sl@0
|
284 |
} {1 {missing starting index}}
|
sl@0
|
285 |
test lsearch-10.6 {binary search with offset} {
|
sl@0
|
286 |
set res {}
|
sl@0
|
287 |
for {set i 0} {$i < 100} {incr i} {
|
sl@0
|
288 |
lappend res [lsearch -integer -start 2 -sorted $increasingIntegers $i]
|
sl@0
|
289 |
}
|
sl@0
|
290 |
set res
|
sl@0
|
291 |
} [concat -1 -1 [lrange $increasingIntegers 2 end]]
|
sl@0
|
292 |
test lsearch-10.7 {offset searching with an empty list} {
|
sl@0
|
293 |
# Stop bug #694232 from reocurring
|
sl@0
|
294 |
lsearch -start 0 {} x
|
sl@0
|
295 |
} -1
|
sl@0
|
296 |
test lsearch-10.8 {offset searching past the end of the list} {
|
sl@0
|
297 |
# Stop [Bug 1374778] from reoccurring
|
sl@0
|
298 |
lsearch -start 10 {a b c} c
|
sl@0
|
299 |
} -1
|
sl@0
|
300 |
test lsearch-10.9 {offset searching past the end of the list} {
|
sl@0
|
301 |
# Stop [Bug 1374778] from reoccurring
|
sl@0
|
302 |
lsearch -start 10 -all {a b c} c
|
sl@0
|
303 |
} {}
|
sl@0
|
304 |
test lsearch-10.10 {offset searching past the end of the list} {
|
sl@0
|
305 |
# Stop [Bug 1374778] from reoccurring
|
sl@0
|
306 |
lsearch -start 10 -inline {a b c} c
|
sl@0
|
307 |
} {}
|
sl@0
|
308 |
|
sl@0
|
309 |
test lsearch-11.1 {negated searches} {
|
sl@0
|
310 |
lsearch -not {a a a b a a a} a
|
sl@0
|
311 |
} 3
|
sl@0
|
312 |
test lsearch-11.2 {negated searches} {
|
sl@0
|
313 |
lsearch -not {a a a a a a a} a
|
sl@0
|
314 |
} -1
|
sl@0
|
315 |
|
sl@0
|
316 |
test lsearch-12.1 {return values instead of indices} {
|
sl@0
|
317 |
lsearch -glob -inline {a1 b2 c3 d4} c*
|
sl@0
|
318 |
} c3
|
sl@0
|
319 |
test lsearch-12.2 {return values instead of indices} {
|
sl@0
|
320 |
lsearch -glob -inline {a1 b2 c3 d4} e*
|
sl@0
|
321 |
} {}
|
sl@0
|
322 |
|
sl@0
|
323 |
test lsearch-13.1 {search for all matches} {
|
sl@0
|
324 |
lsearch -all {a b a c a d} 1
|
sl@0
|
325 |
} {}
|
sl@0
|
326 |
test lsearch-13.2 {search for all matches} {
|
sl@0
|
327 |
lsearch -all {a b a c a d} a
|
sl@0
|
328 |
} {0 2 4}
|
sl@0
|
329 |
|
sl@0
|
330 |
test lsearch-14.1 {combinations: -all and -inline} {
|
sl@0
|
331 |
lsearch -all -inline -glob {a1 b2 a3 c4 a5 d6} a*
|
sl@0
|
332 |
} {a1 a3 a5}
|
sl@0
|
333 |
test lsearch-14.2 {combinations: -all, -inline and -not} {
|
sl@0
|
334 |
lsearch -all -inline -not -glob {a1 b2 a3 c4 a5 d6} a*
|
sl@0
|
335 |
} {b2 c4 d6}
|
sl@0
|
336 |
test lsearch-14.3 {combinations: -all and -not} {
|
sl@0
|
337 |
lsearch -all -not -glob {a1 b2 a3 c4 a5 d6} a*
|
sl@0
|
338 |
} {1 3 5}
|
sl@0
|
339 |
test lsearch-14.4 {combinations: -inline and -not} {
|
sl@0
|
340 |
lsearch -inline -not -glob {a1 b2 a3 c4 a5 d6} a*
|
sl@0
|
341 |
} {b2}
|
sl@0
|
342 |
test lsearch-14.5 {combinations: -start, -all and -inline} {
|
sl@0
|
343 |
lsearch -start 2 -all -inline -glob {a1 b2 a3 c4 a5 d6} a*
|
sl@0
|
344 |
} {a3 a5}
|
sl@0
|
345 |
test lsearch-14.6 {combinations: -start, -all, -inline and -not} {
|
sl@0
|
346 |
lsearch -start 2 -all -inline -not -glob {a1 b2 a3 c4 a5 d6} a*
|
sl@0
|
347 |
} {c4 d6}
|
sl@0
|
348 |
test lsearch-14.7 {combinations: -start, -all and -not} {
|
sl@0
|
349 |
lsearch -start 2 -all -not -glob {a1 b2 a3 c4 a5 d6} a*
|
sl@0
|
350 |
} {3 5}
|
sl@0
|
351 |
test lsearch-14.8 {combinations: -start, -inline and -not} {
|
sl@0
|
352 |
lsearch -start 2 -inline -not -glob {a1 b2 a3 c4 a5 d6} a*
|
sl@0
|
353 |
} {c4}
|
sl@0
|
354 |
|
sl@0
|
355 |
test lsearch-15.1 {make sure no shimmering occurs} {
|
sl@0
|
356 |
set x [expr int(sin(0))]
|
sl@0
|
357 |
lsearch -start $x $x $x
|
sl@0
|
358 |
} 0
|
sl@0
|
359 |
|
sl@0
|
360 |
test lsearch-16.1 {lsearch -regexp shared object} {
|
sl@0
|
361 |
set str a
|
sl@0
|
362 |
lsearch -regexp $str $str
|
sl@0
|
363 |
} 0
|
sl@0
|
364 |
# Bug 1366683
|
sl@0
|
365 |
test lsearch-16.2 {lsearch -regexp allows internal backrefs} {
|
sl@0
|
366 |
lsearch -regexp {a aa b} {(.)\1}
|
sl@0
|
367 |
} 1
|
sl@0
|
368 |
|
sl@0
|
369 |
# cleanup
|
sl@0
|
370 |
catch {unset res}
|
sl@0
|
371 |
catch {unset increasingIntegers}
|
sl@0
|
372 |
catch {unset decreasingIntegers}
|
sl@0
|
373 |
catch {unset increasingDoubles}
|
sl@0
|
374 |
catch {unset decreasingDoubles}
|
sl@0
|
375 |
catch {unset increasingStrings}
|
sl@0
|
376 |
catch {unset decreasingStrings}
|
sl@0
|
377 |
catch {unset increasingDictionary}
|
sl@0
|
378 |
catch {unset decreasingDictionary}
|
sl@0
|
379 |
::tcltest::cleanupTests
|
sl@0
|
380 |
return
|