perl 1.0 patch 13: fix for faulty patch 12, plus random portability glitches
[p5sagit/p5-mst-13.2.git] / t / op.split
1 #!./perl
2
3 # $Header: op.split,v 1.0.1.1 88/02/02 11:26:37 root Exp $
4
5 print "1..6\n";
6
7 $FS = ':';
8
9 $_ = 'a:b:c';
10
11 ($a,$b,$c) = split($FS,$_);
12
13 if (join(';',$a,$b,$c) eq 'a;b;c') {print "ok 1\n";} else {print "not ok 1\n";}
14
15 @ary = split(/:b:/);
16 if (join("$_",@ary) eq 'aa:b:cc') {print "ok 2\n";} else {print "not ok 2\n";}
17
18 $_ = "abc\n";
19 @ary = split(//);
20 if (join(".",@ary) eq "a.b.c.\n") {print "ok 3\n";} else {print "not ok 3\n";}
21
22 $_ = "a:b:c::::";
23 @ary = split(/:/);
24 if (join(".",@ary) eq "a.b.c") {print "ok 4\n";} else {print "not ok 4\n";}
25
26 $_ = join(':',split(' ','    a b        c '));
27 if ($_ eq 'a:b:c') {print "ok 5\n";} else {print "not ok 5\n";}
28
29 $_ = join(':',split(/ */,"foo  bar bie\tdoll"));
30 if ($_ eq "f:o:o:b:a:r:b:i:e:\t:d:o:l:l")
31         {print "ok 6\n";} else {print "not ok 6\n";}