This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
allow Configure -S to run non-interactively (spotted by Greg Hudson
[perl5.git] / t / op / join.t
1 #!./perl
2
3 print "1..6\n";
4
5 @x = (1, 2, 3);
6 if (join(':',@x) eq '1:2:3') {print "ok 1\n";} else {print "not ok 1\n";}
7
8 if (join('',1,2,3) eq '123') {print "ok 2\n";} else {print "not ok 2\n";}
9
10 if (join(':',split(/ /,"1 2 3")) eq '1:2:3') {print "ok 3\n";} else {print "not ok 3\n";}
11
12 my $f = 'a';
13 $f = join ',', 'b', $f, 'e';
14 if ($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';
18 if ($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';
22 if ($f eq 'baeak') {print "ok 6\n";} else {print "# '$f'\nnot ok 6\n";}