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
16 is [set a 2; append a] 2 {var only}
17 is [set a 1; append a 2] 12 {append once}
18 is [set a 1; append a 2 3] 123 {append twice}
19 #append chicken soup with rice.
21 is [set x ""; append x 1 2 abc "long string"] \
22 {12abclong string} {empty with several args}
26 append x 1 2 abc "long string"
27 } {12abclong string} {unset variable}
30 {wrong # args: should be "append varName ?value value ...?"} \
36 } {can't set "x(0)": variable isn't array} {no args}
38 # Tcl currently throws an error for this code
39 # but a bug has been filed for it at http://tcl.sf.net (#1227172)
43 } {can't read "x": no such variable} {append unset variable}