summaryrefslogtreecommitdiffstats
path: root/tests/linsert.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2008-09-29 15:38:30 (GMT)
committerdgp <dgp@users.sourceforge.net>2008-09-29 15:38:30 (GMT)
commitf47fa38944c02518936f12a7bf883cb48b7feca8 (patch)
tree62808331cf01b5b0f66996784fd4d1e96e83d9e8 /tests/linsert.test
parent7e9fde3466a3436d634d966a64f73d900e274d88 (diff)
downloadtcl-f47fa38944c02518936f12a7bf883cb48b7feca8.zip
tcl-f47fa38944c02518936f12a7bf883cb48b7feca8.tar.gz
tcl-f47fa38944c02518936f12a7bf883cb48b7feca8.tar.bz2
TIP #323 IMPLEMENTATION (partial)
* doc/linsert.n: Revise [linsert] to accept zero elements. * generic/tclCmdIL.c: * tests/linsert.test:
Diffstat (limited to 'tests/linsert.test')
-rw-r--r--tests/linsert.test12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/linsert.test b/tests/linsert.test
index 3419c74..e9c545a 100644
--- a/tests/linsert.test
+++ b/tests/linsert.test
@@ -11,7 +11,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: linsert.test,v 1.10 2005/05/10 18:35:22 kennykb Exp $
+# RCS: @(#) $Id: linsert.test,v 1.11 2008/09/29 15:38:32 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -84,16 +84,22 @@ test linsert-1.20 {linsert command, use of end-int index} {
test linsert-2.1 {linsert errors} {
list [catch linsert msg] $msg
-} {1 {wrong # args: should be "linsert list index element ?element ...?"}}
+} {1 {wrong # args: should be "linsert list index ?element ...?"}}
test linsert-2.2 {linsert errors} {
list [catch {linsert a b} msg] $msg
-} {1 {wrong # args: should be "linsert list index element ?element ...?"}}
+} {1 {bad index "b": must be integer?[+-]integer? or end?[+-]integer?}}
test linsert-2.3 {linsert errors} {
list [catch {linsert a 12x 2} msg] $msg
} {1 {bad index "12x": must be integer?[+-]integer? or end?[+-]integer?}}
test linsert-2.4 {linsert errors} {
list [catch {linsert \{ 12 2} msg] $msg
} {1 {unmatched open brace in list}}
+test linsert-2.5 {syntax (TIP 323)} {
+ linsert {a b c} 0
+} [list a b c]
+test linsert-2.6 {syntax (TIP 323)} {
+ linsert "a\nb\nc" 0
+} [list a b c]
test linsert-3.1 {linsert won't modify shared argument objects} {
proc p {} {