os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/tests/lset.test
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
# This file is a -*- tcl -*- test script
sl@0
     2
sl@0
     3
# Commands covered: lset
sl@0
     4
#
sl@0
     5
# This file contains a collection of tests for one or more of the Tcl
sl@0
     6
# built-in commands.  Sourcing this file into Tcl runs the tests and
sl@0
     7
# generates output for errors.  No output means no errors were found.
sl@0
     8
#
sl@0
     9
# Copyright (c) 2001 by Kevin B. Kenny.  All rights reserved.
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$
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
proc failTrace {name1 name2 op} {
sl@0
    22
    error "trace failed"
sl@0
    23
}
sl@0
    24
sl@0
    25
set lset lset
sl@0
    26
sl@0
    27
set noRead {}
sl@0
    28
trace add variable noRead read failTrace
sl@0
    29
set noWrite {a b c}
sl@0
    30
trace add variable noWrite write failTrace
sl@0
    31
sl@0
    32
test lset-1.1 {lset, not compiled, arg count} {
sl@0
    33
    list [catch {eval $lset} msg] $msg
sl@0
    34
} "1 {wrong \# args: should be \"lset listVar index ?index...? value\"}"
sl@0
    35
sl@0
    36
test lset-1.2 {lset, not compiled, no such var} {
sl@0
    37
    list [catch {eval [list $lset noSuchVar 0 {}]} msg] $msg
sl@0
    38
} "1 {can't read \"noSuchVar\": no such variable}"
sl@0
    39
sl@0
    40
test lset-1.3 {lset, not compiled, var not readable} {
sl@0
    41
    list [catch {eval [list $lset noRead 0 {}]} msg] $msg
sl@0
    42
} "1 {can't read \"noRead\": trace failed}"
sl@0
    43
sl@0
    44
test lset-2.1 {lset, not compiled, 3 args, second arg a plain index} {
sl@0
    45
    set x {0 1 2}
sl@0
    46
    list [eval [list $lset x 0 3]] $x
sl@0
    47
} {{3 1 2} {3 1 2}}
sl@0
    48
sl@0
    49
test lset-2.2 {lset, not compiled, 3 args, second arg neither index nor list} {
sl@0
    50
    set x {0 1 2}
sl@0
    51
    list [catch {
sl@0
    52
	eval [list $lset x {{bad}1} 3]
sl@0
    53
    } msg] $msg
sl@0
    54
} "1 {bad index \"{bad}1\": must be integer or end?-integer?}"
sl@0
    55
sl@0
    56
test lset-3.1 {lset, not compiled, 3 args, data duplicated} {
sl@0
    57
    set x {0 1 2}
sl@0
    58
    list [eval [list $lset x 0 $x]] $x
sl@0
    59
} {{{0 1 2} 1 2} {{0 1 2} 1 2}}
sl@0
    60
sl@0
    61
test lset-3.2 {lset, not compiled, 3 args, data duplicated} {
sl@0
    62
    set x {0 1}
sl@0
    63
    set y $x
sl@0
    64
    list [eval [list $lset x 0 2]] $x $y
sl@0
    65
} {{2 1} {2 1} {0 1}}
sl@0
    66
sl@0
    67
test lset-3.3 {lset, not compiled, 3 args, data duplicated} {
sl@0
    68
    set x {0 1}
sl@0
    69
    set y $x
sl@0
    70
    list [eval [list $lset x 0 $x]] $x $y
sl@0
    71
} {{{0 1} 1} {{0 1} 1} {0 1}}
sl@0
    72
sl@0
    73
test lset-3.4 {lset, not compiled, 3 args, data duplicated} {
sl@0
    74
    set x {0 1 2}
sl@0
    75
    list [eval [list $lset x [list 0] $x]] $x
sl@0
    76
} {{{0 1 2} 1 2} {{0 1 2} 1 2}}
sl@0
    77
sl@0
    78
test lset-3.5 {lset, not compiled, 3 args, data duplicated} {
sl@0
    79
    set x {0 1}
sl@0
    80
    set y $x
sl@0
    81
    list [eval [list $lset x [list 0] 2]] $x $y
sl@0
    82
} {{2 1} {2 1} {0 1}}
sl@0
    83
sl@0
    84
test lset-3.6 {lset, not compiled, 3 args, data duplicated} {
sl@0
    85
    set x {0 1}
sl@0
    86
    set y $x
sl@0
    87
    list [eval [list $lset x [list 0] $x]] $x $y
sl@0
    88
} {{{0 1} 1} {{0 1} 1} {0 1}}
sl@0
    89
sl@0
    90
test lset-4.1 {lset, not compiled, 3 args, not a list} {
sl@0
    91
    set a "x \{"
sl@0
    92
    list [catch {
sl@0
    93
	eval [list $lset a [list 0] y]
sl@0
    94
    } msg] $msg
sl@0
    95
} {1 {unmatched open brace in list}}
sl@0
    96
sl@0
    97
test lset-4.2 {lset, not compiled, 3 args, bad index} {
sl@0
    98
    set a {x y z}
sl@0
    99
    list [catch {
sl@0
   100
	eval [list $lset a [list 2a2] w]
sl@0
   101
    } msg] $msg
sl@0
   102
} {1 {bad index "2a2": must be integer or end?-integer?}}
sl@0
   103
sl@0
   104
test lset-4.3 {lset, not compiled, 3 args, index out of range} {
sl@0
   105
    set a {x y z}
sl@0
   106
    list [catch {
sl@0
   107
	eval [list $lset a [list -1] w]
sl@0
   108
    } msg] $msg
sl@0
   109
} {1 {list index out of range}}
sl@0
   110
sl@0
   111
test lset-4.4 {lset, not compiled, 3 args, index out of range} {
sl@0
   112
    set a {x y z}
sl@0
   113
    list [catch {
sl@0
   114
	eval [list $lset a [list 3] w]
sl@0
   115
    } msg] $msg
sl@0
   116
} {1 {list index out of range}}
sl@0
   117
sl@0
   118
test lset-4.5 {lset, not compiled, 3 args, index out of range} {
sl@0
   119
    set a {x y z}
sl@0
   120
    list [catch {
sl@0
   121
	eval [list $lset a [list end--1] w]
sl@0
   122
    } msg] $msg
sl@0
   123
} {1 {list index out of range}}
sl@0
   124
sl@0
   125
test lset-4.6 {lset, not compiled, 3 args, index out of range} {
sl@0
   126
    set a {x y z}
sl@0
   127
    list [catch {
sl@0
   128
	eval [list $lset a [list end-3] w]
sl@0
   129
    } msg] $msg
sl@0
   130
} {1 {list index out of range}}
sl@0
   131
sl@0
   132
test lset-4.7 {lset, not compiled, 3 args, not a list} {
sl@0
   133
    set a "x \{"
sl@0
   134
    list [catch {
sl@0
   135
	eval [list $lset a 0 y]
sl@0
   136
    } msg] $msg
sl@0
   137
} {1 {unmatched open brace in list}}
sl@0
   138
sl@0
   139
test lset-4.8 {lset, not compiled, 3 args, bad index} {
sl@0
   140
    set a {x y z}
sl@0
   141
    list [catch {
sl@0
   142
	eval [list $lset a 2a2 w]
sl@0
   143
    } msg] $msg
sl@0
   144
} {1 {bad index "2a2": must be integer or end?-integer?}}
sl@0
   145
sl@0
   146
test lset-4.9 {lset, not compiled, 3 args, index out of range} {
sl@0
   147
    set a {x y z}
sl@0
   148
    list [catch {
sl@0
   149
	eval [list $lset a -1 w]
sl@0
   150
    } msg] $msg
sl@0
   151
} {1 {list index out of range}}
sl@0
   152
sl@0
   153
test lset-4.10 {lset, not compiled, 3 args, index out of range} {
sl@0
   154
    set a {x y z}
sl@0
   155
    list [catch {
sl@0
   156
	eval [list $lset a 3 w]
sl@0
   157
    } msg] $msg
sl@0
   158
} {1 {list index out of range}}
sl@0
   159
sl@0
   160
test lset-4.11 {lset, not compiled, 3 args, index out of range} {
sl@0
   161
    set a {x y z}
sl@0
   162
    list [catch {
sl@0
   163
	eval [list $lset a end--1 w]
sl@0
   164
    } msg] $msg
sl@0
   165
} {1 {list index out of range}}
sl@0
   166
sl@0
   167
test lset-4.12 {lset, not compiled, 3 args, index out of range} {
sl@0
   168
    set a {x y z}
sl@0
   169
    list [catch {
sl@0
   170
	eval [list $lset a end-3 w]
sl@0
   171
    } msg] $msg
sl@0
   172
} {1 {list index out of range}}
sl@0
   173
sl@0
   174
test lset-5.1 {lset, not compiled, 3 args, can't set variable} {
sl@0
   175
    list [catch {
sl@0
   176
	eval [list $lset noWrite 0 d]
sl@0
   177
    } msg] $msg $noWrite
sl@0
   178
} {1 {can't set "noWrite": trace failed} {d b c}}
sl@0
   179
sl@0
   180
test lset-5.2 {lset, not compiled, 3 args, can't set variable} {
sl@0
   181
    list [catch {
sl@0
   182
	eval [list $lset noWrite [list 0] d]
sl@0
   183
    } msg] $msg $noWrite
sl@0
   184
} {1 {can't set "noWrite": trace failed} {d b c}}
sl@0
   185
sl@0
   186
test lset-6.1 {lset, not compiled, 3 args, 1-d list basics} {
sl@0
   187
    set a {x y z}
sl@0
   188
    list [eval [list $lset a 0 a]] $a
sl@0
   189
} {{a y z} {a y z}}
sl@0
   190
sl@0
   191
test lset-6.2 {lset, not compiled, 3 args, 1-d list basics} {
sl@0
   192
    set a {x y z}
sl@0
   193
    list [eval [list $lset a [list 0] a]] $a
sl@0
   194
} {{a y z} {a y z}}
sl@0
   195
sl@0
   196
test lset-6.3 {lset, not compiled, 1-d list basics} {
sl@0
   197
    set a {x y z}
sl@0
   198
    list [eval [list $lset a 2 a]] $a
sl@0
   199
} {{x y a} {x y a}}
sl@0
   200
sl@0
   201
test lset-6.4 {lset, not compiled, 1-d list basics} {
sl@0
   202
    set a {x y z}
sl@0
   203
    list [eval [list $lset a [list 2] a]] $a
sl@0
   204
} {{x y a} {x y a}}
sl@0
   205
sl@0
   206
test lset-6.5 {lset, not compiled, 1-d list basics} {
sl@0
   207
    set a {x y z}
sl@0
   208
    list [eval [list $lset a end a]] $a
sl@0
   209
} {{x y a} {x y a}}
sl@0
   210
sl@0
   211
test lset-6.6 {lset, not compiled, 1-d list basics} {
sl@0
   212
    set a {x y z}
sl@0
   213
    list [eval [list $lset a [list end] a]] $a
sl@0
   214
} {{x y a} {x y a}}
sl@0
   215
sl@0
   216
test lset-6.7 {lset, not compiled, 1-d list basics} {
sl@0
   217
    set a {x y z}
sl@0
   218
    list [eval [list $lset a end-0 a]] $a
sl@0
   219
} {{x y a} {x y a}}
sl@0
   220
sl@0
   221
test lset-6.8 {lset, not compiled, 1-d list basics} {
sl@0
   222
    set a {x y z}
sl@0
   223
    list [eval [list $lset a [list end-0] a]] $a
sl@0
   224
} {{x y a} {x y a}}
sl@0
   225
sl@0
   226
test lset-6.9 {lset, not compiled, 1-d list basics} {
sl@0
   227
    set a {x y z}
sl@0
   228
    list [eval [list $lset a end-2 a]] $a
sl@0
   229
} {{a y z} {a y z}}
sl@0
   230
sl@0
   231
test lset-6.10 {lset, not compiled, 1-d list basics} {
sl@0
   232
    set a {x y z}
sl@0
   233
    list [eval [list $lset a [list end-2] a]] $a
sl@0
   234
} {{a y z} {a y z}}
sl@0
   235
sl@0
   236
test lset-7.1 {lset, not compiled, data sharing} {
sl@0
   237
    set a 0
sl@0
   238
    list [eval [list $lset a $a {gag me}]] $a
sl@0
   239
} {{{gag me}} {{gag me}}}
sl@0
   240
sl@0
   241
test lset-7.2 {lset, not compiled, data sharing} {
sl@0
   242
    set a [list 0]
sl@0
   243
    list [eval [list $lset a $a {gag me}]] $a
sl@0
   244
} {{{gag me}} {{gag me}}}
sl@0
   245
sl@0
   246
test lset-7.3 {lset, not compiled, data sharing} {
sl@0
   247
    set a {x y}
sl@0
   248
    list [eval [list $lset a 0 $a]] $a
sl@0
   249
} {{{x y} y} {{x y} y}}
sl@0
   250
sl@0
   251
test lset-7.4 {lset, not compiled, data sharing} {
sl@0
   252
    set a {x y}
sl@0
   253
    list [eval [list $lset a [list 0] $a]] $a
sl@0
   254
} {{{x y} y} {{x y} y}}
sl@0
   255
sl@0
   256
test lset-7.5 {lset, not compiled, data sharing} {
sl@0
   257
    set n 0
sl@0
   258
    set a {x y}
sl@0
   259
    list [eval [list $lset a $n $n]] $a $n
sl@0
   260
} {{0 y} {0 y} 0}
sl@0
   261
sl@0
   262
test lset-7.6 {lset, not compiled, data sharing} {
sl@0
   263
    set n [list 0]
sl@0
   264
    set a {x y}
sl@0
   265
    list [eval [list $lset a $n $n]] $a $n
sl@0
   266
} {{0 y} {0 y} 0}
sl@0
   267
sl@0
   268
test lset-7.7 {lset, not compiled, data sharing} {
sl@0
   269
    set n 0
sl@0
   270
    set a [list $n $n]
sl@0
   271
    list [eval [list $lset a $n 1]] $a $n
sl@0
   272
} {{1 0} {1 0} 0}
sl@0
   273
sl@0
   274
test lset-7.8 {lset, not compiled, data sharing} {
sl@0
   275
    set n [list 0]
sl@0
   276
    set a [list $n $n]
sl@0
   277
    list [eval [list $lset a $n 1]] $a $n
sl@0
   278
} {{1 0} {1 0} 0}
sl@0
   279
sl@0
   280
test lset-7.9 {lset, not compiled, data sharing} {
sl@0
   281
    set a 0
sl@0
   282
    list [eval [list $lset a $a $a]] $a
sl@0
   283
} {0 0}
sl@0
   284
sl@0
   285
test lset-7.10 {lset, not compiled, data sharing} {
sl@0
   286
    set a [list 0]
sl@0
   287
    list [eval [list $lset a $a $a]] $a
sl@0
   288
} {0 0}
sl@0
   289
sl@0
   290
test lset-8.1 {lset, not compiled, malformed sublist} {
sl@0
   291
    set a [list "a \{" b]
sl@0
   292
    list [catch {eval [list $lset a 0 1 c]} msg] $msg
sl@0
   293
} {1 {unmatched open brace in list}}
sl@0
   294
sl@0
   295
test lset-8.2 {lset, not compiled, malformed sublist} {
sl@0
   296
    set a [list "a \{" b]
sl@0
   297
    list [catch {eval [list $lset a {0 1} c]} msg] $msg
sl@0
   298
} {1 {unmatched open brace in list}}
sl@0
   299
sl@0
   300
test lset-8.3 {lset, not compiled, bad second index} {
sl@0
   301
    set a {{b c} {d e}}
sl@0
   302
    list [catch {eval [list $lset a 0 2a2 f]} msg] $msg
sl@0
   303
} {1 {bad index "2a2": must be integer or end?-integer?}}
sl@0
   304
sl@0
   305
test lset-8.4 {lset, not compiled, bad second index} {
sl@0
   306
    set a {{b c} {d e}}
sl@0
   307
    list [catch {eval [list $lset a {0 2a2} f]} msg] $msg
sl@0
   308
} {1 {bad index "2a2": must be integer or end?-integer?}}
sl@0
   309
sl@0
   310
test lset-8.5 {lset, not compiled, second index out of range} {
sl@0
   311
    set a {{b c} {d e} {f g}}
sl@0
   312
    list [catch {eval [list $lset a 2 -1 h]} msg] $msg
sl@0
   313
} {1 {list index out of range}}
sl@0
   314
sl@0
   315
test lset-8.6 {lset, not compiled, second index out of range} {
sl@0
   316
    set a {{b c} {d e} {f g}}
sl@0
   317
    list [catch {eval [list $lset a {2 -1} h]} msg] $msg
sl@0
   318
} {1 {list index out of range}}
sl@0
   319
sl@0
   320
test lset-8.7 {lset, not compiled, second index out of range} {
sl@0
   321
    set a {{b c} {d e} {f g}}
sl@0
   322
    list [catch {eval [list $lset a 2 2 h]} msg] $msg
sl@0
   323
} {1 {list index out of range}}
sl@0
   324
sl@0
   325
test lset-8.8 {lset, not compiled, second index out of range} {
sl@0
   326
    set a {{b c} {d e} {f g}}
sl@0
   327
    list [catch {eval [list $lset a {2 2} h]} msg] $msg
sl@0
   328
} {1 {list index out of range}}
sl@0
   329
sl@0
   330
test lset-8.9 {lset, not compiled, second index out of range} {
sl@0
   331
    set a {{b c} {d e} {f g}}
sl@0
   332
    list [catch {eval [list $lset a 2 end--1 h]} msg] $msg
sl@0
   333
} {1 {list index out of range}}
sl@0
   334
sl@0
   335
test lset-8.10 {lset, not compiled, second index out of range} {
sl@0
   336
    set a {{b c} {d e} {f g}}
sl@0
   337
    list [catch {eval [list $lset a {2 end--1} h]} msg] $msg
sl@0
   338
} {1 {list index out of range}}
sl@0
   339
sl@0
   340
test lset-8.11 {lset, not compiled, second index out of range} {
sl@0
   341
    set a {{b c} {d e} {f g}}
sl@0
   342
    list [catch {eval [list $lset a 2 end-2 h]} msg] $msg
sl@0
   343
} {1 {list index out of range}}
sl@0
   344
sl@0
   345
test lset-8.12 {lset, not compiled, second index out of range} {
sl@0
   346
    set a {{b c} {d e} {f g}}
sl@0
   347
    list [catch {eval [list $lset a {2 end-2} h]} msg] $msg
sl@0
   348
} {1 {list index out of range}}
sl@0
   349
sl@0
   350
test lset-9.1 {lset, not compiled, entire variable} {
sl@0
   351
    set a x
sl@0
   352
    list [eval [list $lset a y]] $a
sl@0
   353
} {y y}
sl@0
   354
sl@0
   355
test lset-9.2 {lset, not compiled, entire variable} {
sl@0
   356
    set a x
sl@0
   357
    list [eval [list $lset a {} y]] $a
sl@0
   358
} {y y}
sl@0
   359
sl@0
   360
test lset-10.1 {lset, not compiled, shared data} {
sl@0
   361
    set row {p q}
sl@0
   362
    set a [list $row $row]
sl@0
   363
    list [eval [list $lset a 0 0 x]] $a
sl@0
   364
} {{{x q} {p q}} {{x q} {p q}}}
sl@0
   365
sl@0
   366
test lset-10.2 {lset, not compiled, shared data} {
sl@0
   367
    set row {p q}
sl@0
   368
    set a [list $row $row]
sl@0
   369
    list [eval [list $lset a {0 0} x]] $a
sl@0
   370
} {{{x q} {p q}} {{x q} {p q}}}
sl@0
   371
sl@0
   372
test lset-11.1 {lset, not compiled, 2-d basics} {
sl@0
   373
    set a {{b c} {d e}}
sl@0
   374
    list [eval [list $lset a 0 0 f]] $a
sl@0
   375
} {{{f c} {d e}} {{f c} {d e}}}
sl@0
   376
sl@0
   377
test lset-11.2 {lset, not compiled, 2-d basics} {
sl@0
   378
    set a {{b c} {d e}}
sl@0
   379
    list [eval [list $lset a {0 0} f]] $a
sl@0
   380
} {{{f c} {d e}} {{f c} {d e}}}
sl@0
   381
sl@0
   382
test lset-11.3 {lset, not compiled, 2-d basics} {
sl@0
   383
    set a {{b c} {d e}}
sl@0
   384
    list [eval [list $lset a 0 1 f]] $a
sl@0
   385
} {{{b f} {d e}} {{b f} {d e}}}
sl@0
   386
sl@0
   387
test lset-11.4 {lset, not compiled, 2-d basics} {
sl@0
   388
    set a {{b c} {d e}}
sl@0
   389
    list [eval [list $lset a {0 1} f]] $a
sl@0
   390
} {{{b f} {d e}} {{b f} {d e}}}
sl@0
   391
sl@0
   392
test lset-11.5 {lset, not compiled, 2-d basics} {
sl@0
   393
    set a {{b c} {d e}}
sl@0
   394
    list [eval [list $lset a 1 0 f]] $a
sl@0
   395
} {{{b c} {f e}} {{b c} {f e}}}
sl@0
   396
sl@0
   397
test lset-11.6 {lset, not compiled, 2-d basics} {
sl@0
   398
    set a {{b c} {d e}}
sl@0
   399
    list [eval [list $lset a {1 0} f]] $a
sl@0
   400
} {{{b c} {f e}} {{b c} {f e}}}
sl@0
   401
sl@0
   402
test lset-11.7 {lset, not compiled, 2-d basics} {
sl@0
   403
    set a {{b c} {d e}}
sl@0
   404
    list [eval [list $lset a 1 1 f]] $a
sl@0
   405
} {{{b c} {d f}} {{b c} {d f}}}
sl@0
   406
sl@0
   407
test lset-11.8 {lset, not compiled, 2-d basics} {
sl@0
   408
    set a {{b c} {d e}}
sl@0
   409
    list [eval [list $lset a {1 1} f]] $a
sl@0
   410
} {{{b c} {d f}} {{b c} {d f}}}
sl@0
   411
sl@0
   412
test lset-12.0 {lset, not compiled, typical sharing pattern} {
sl@0
   413
    set zero 0
sl@0
   414
    set row [list $zero $zero $zero $zero]
sl@0
   415
    set ident [list $row $row $row $row]
sl@0
   416
    for { set i 0 } { $i < 4 } { incr i } {
sl@0
   417
	eval [list $lset ident $i $i 1]
sl@0
   418
    }
sl@0
   419
    set ident
sl@0
   420
} {{1 0 0 0} {0 1 0 0} {0 0 1 0} {0 0 0 1}}
sl@0
   421
sl@0
   422
test lset-13.0 {lset, not compiled, shimmering hell} {
sl@0
   423
    set a 0
sl@0
   424
    list [eval [list $lset a $a $a $a $a {gag me}]] $a
sl@0
   425
} {{{{{{gag me}}}}} {{{{{gag me}}}}}}
sl@0
   426
sl@0
   427
test lset-13.1 {lset, not compiled, shimmering hell} {
sl@0
   428
    set a [list 0]
sl@0
   429
    list [eval [list $lset a $a $a $a $a {gag me}]] $a
sl@0
   430
} {{{{{{gag me}}}}} {{{{{gag me}}}}}}
sl@0
   431
sl@0
   432
test lset-13.2 {lset, not compiled, shimmering hell} {
sl@0
   433
    set a [list 0 0 0 0]
sl@0
   434
    list [eval [list $lset a $a {gag me}]] $a
sl@0
   435
} {{{{{{gag me}}}} 0 0 0} {{{{{gag me}}}} 0 0 0}}
sl@0
   436
sl@0
   437
test lset-14.1 {lset, not compiled, list args, is string rep preserved?} {
sl@0
   438
    set a { { 1 2 } { 3 4 } }
sl@0
   439
    catch { eval [list $lset a {1 5} 5] }
sl@0
   440
    list $a [lindex $a 1]
sl@0
   441
} "{ { 1 2 } { 3 4 } } { 3 4 }"
sl@0
   442
sl@0
   443
test lset-14.2 {lset, not compiled, flat args, is string rep preserved?} {
sl@0
   444
    set a { { 1 2 } { 3 4 } }
sl@0
   445
    catch { eval [list $lset a 1 5 5] }
sl@0
   446
    list $a [lindex $a 1]
sl@0
   447
} "{ { 1 2 } { 3 4 } } { 3 4 }"
sl@0
   448
sl@0
   449
catch {unset noRead}
sl@0
   450
catch {unset noWrite}
sl@0
   451
catch {rename failTrace {}}
sl@0
   452
catch {unset ::x}
sl@0
   453
catch {unset ::y}
sl@0
   454
sl@0
   455
# cleanup
sl@0
   456
::tcltest::cleanupTests
sl@0
   457
return