tagged release 0.7.1
[parrot.git] / languages / tcl / t / cmd_split.t
blobdefd7179f5d4dc1b6d51f4f4993722183fe175d3
1 #!perl
3 # Copyright (C) 2006-2007, The Perl Foundation.
4 # $Id$
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); # \
9 use Tcl::Test; #\
10 __DATA__
12 source lib/test_more.tcl
13 plan 7
15 eval_is {split}  \
16   {wrong # args: should be "split string ?splitChars?"} \
17   {split too few args}
19 eval_is {split a b c}  \
20   {wrong # args: should be "split string ?splitChars?"} \
21   {split too many args}
23 is [lindex [split {that is fun}] 2] fun {split default}
25 is [split {Modern Major General} {}] \
26   {M o d e r n { } M a j o r { } G e n e r a l} \
27   {split empty string}
29 is [split {perl.perl6.language} .] \
30   {perl perl6 language} {split single char}
32 is [split {perl.perl6.language} glop] \
33   {{} er . er 6. an ua e} {split multi char}
35 is [split {perl.perl6.language} z] {perl.perl6.language} {split and a miss}