3 # Copyright (C) 2004-2006, The Perl Foundation.
6 # the following lines re-execute this as a tcl script
7 # the \ at the end of these lines makes them a comment in tcl \
8 use lib qw(languages/tcl/lib tcl/lib lib ../lib ../../lib); # \
12 source lib/test_more.tcl
15 is [linsert [list] 0 a] a {insert beginning empty list}
16 is [linsert [list] 20 a] a {insert beyond end of empty list}
17 is [linsert [list a] end b] {a b} {insert beyond end of single list}
18 is [linsert [list a c] end-1 b] {a b c} {insert middle double list}
20 is [linsert list 0 new] {new list} {insert at beginning of list}
22 is [linsert [list a b] end [list c d]] {a b {c d}} {insert, sub list}
23 is [linsert [list a b] end c d] {a b c d} {insert, multiple elements}
26 {wrong # args: should be "linsert list index element ?element ...?"} \
30 {wrong # args: should be "linsert list index element ?element ...?"} \
34 linsert [list a c] q b]
35 } {bad index "q": must be integer?[+-]integer? or end?[+-]integer?} \