This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate with Sarathy; manual resolve on regcomp.c conflicts
[perl5.git] / t / op / join.t
CommitLineData
8d063cd8
LW
1#!./perl
2
c212fd85 3print "1..6\n";
8d063cd8
LW
4
5@x = (1, 2, 3);
6if (join(':',@x) eq '1:2:3') {print "ok 1\n";} else {print "not ok 1\n";}
7
8if (join('',1,2,3) eq '123') {print "ok 2\n";} else {print "not ok 2\n";}
9
10if (join(':',split(/ /,"1 2 3")) eq '1:2:3') {print "ok 3\n";} else {print "not ok 3\n";}
c212fd85
IZ
11
12my $f = 'a';
13$f = join ',', 'b', $f, 'e';
14if ($f eq 'b,a,e') {print "ok 4\n";} else {print "# '$f'\nnot ok 4\n";}
15
16$f = 'a';
17$f = join ',', $f, 'b', 'e';
18if ($f eq 'a,b,e') {print "ok 5\n";} else {print "not ok 5\n";}
19
20$f = 'a';
21$f = join $f, 'b', 'e', 'k';
22if ($f eq 'baeak') {print "ok 6\n";} else {print "# '$f'\nnot ok 6\n";}