URL
https://opencores.org/ocsvn/or1k/or1k/trunk
[/] [or1k/] [trunk/] [insight/] [tcl/] [tests/] [concat.test] - Blame information for rev 1765
Details |
Compare with Previous |
View Log
Line No. |
Rev |
Author |
Line |
1 |
578 |
markom |
# Commands covered: concat
|
2 |
|
|
#
|
3 |
|
|
# This file contains a collection of tests for one or more of the Tcl
|
4 |
|
|
# built-in commands. Sourcing this file into Tcl runs the tests and
|
5 |
|
|
# generates output for errors. No output means no errors were found.
|
6 |
|
|
#
|
7 |
|
|
# Copyright (c) 1991-1993 The Regents of the University of California.
|
8 |
|
|
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
9 |
|
|
#
|
10 |
|
|
# See the file "license.terms" for information on usage and redistribution
|
11 |
|
|
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
12 |
|
|
#
|
13 |
|
|
# RCS: @(#) $Id: concat.test,v 1.1.1.1 2002-01-16 10:25:35 markom Exp $
|
14 |
|
|
|
15 |
|
|
if {[string compare test [info procs test]] == 1} then {source defs}
|
16 |
|
|
|
17 |
|
|
test concat-1.1 {simple concatenation} {
|
18 |
|
|
concat a b c d e f g
|
19 |
|
|
} {a b c d e f g}
|
20 |
|
|
test concat-1.2 {merging lists together} {
|
21 |
|
|
concat a {b c d} {e f g h}
|
22 |
|
|
} {a b c d e f g h}
|
23 |
|
|
test concat-1.3 {merge lists, retain sub-lists} {
|
24 |
|
|
concat a {b {c d}} {{e f}} g h
|
25 |
|
|
} {a b {c d} {e f} g h}
|
26 |
|
|
test concat-1.4 {special characters} {
|
27 |
|
|
concat a\{ {b \{c d} \{d
|
28 |
|
|
} "a{ b \\{c d {d"
|
29 |
|
|
|
30 |
|
|
test concat-2.1 {error: one empty argument} {
|
31 |
|
|
concat {}
|
32 |
|
|
} {}
|
33 |
|
|
|
34 |
|
|
test concat-3.1 {error: no arguments} {
|
35 |
|
|
list [catch concat msg] $msg
|
36 |
|
|
} {0 {}}
|
37 |
|
|
|
38 |
|
|
test concat-4.1 {pruning off extra white space} {
|
39 |
|
|
concat {} {a b c}
|
40 |
|
|
} {a b c}
|
41 |
|
|
test concat-4.2 {pruning off extra white space} {
|
42 |
|
|
concat x y " a b c \n\t " " " " def "
|
43 |
|
|
} {x y a b c def}
|
44 |
|
|
test concat-4.3 {pruning off extra white space sets length correctly} {
|
45 |
|
|
llength [concat { {{a}} }]
|
46 |
|
|
} 1
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.