summaryrefslogtreecommitdiffstats
path: root/contrib/perl5/t/op/join.t
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/perl5/t/op/join.t')
-rwxr-xr-xcontrib/perl5/t/op/join.t16
1 files changed, 13 insertions, 3 deletions
diff --git a/contrib/perl5/t/op/join.t b/contrib/perl5/t/op/join.t
index eec4611..def5a9e 100755
--- a/contrib/perl5/t/op/join.t
+++ b/contrib/perl5/t/op/join.t
@@ -1,8 +1,6 @@
#!./perl
-# $RCSfile: join.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:01 $
-
-print "1..3\n";
+print "1..6\n";
@x = (1, 2, 3);
if (join(':',@x) eq '1:2:3') {print "ok 1\n";} else {print "not ok 1\n";}
@@ -10,3 +8,15 @@ if (join(':',@x) eq '1:2:3') {print "ok 1\n";} else {print "not ok 1\n";}
if (join('',1,2,3) eq '123') {print "ok 2\n";} else {print "not ok 2\n";}
if (join(':',split(/ /,"1 2 3")) eq '1:2:3') {print "ok 3\n";} else {print "not ok 3\n";}
+
+my $f = 'a';
+$f = join ',', 'b', $f, 'e';
+if ($f eq 'b,a,e') {print "ok 4\n";} else {print "# '$f'\nnot ok 4\n";}
+
+$f = 'a';
+$f = join ',', $f, 'b', 'e';
+if ($f eq 'a,b,e') {print "ok 5\n";} else {print "not ok 5\n";}
+
+$f = 'a';
+$f = join $f, 'b', 'e', 'k';
+if ($f eq 'baeak') {print "ok 6\n";} else {print "# '$f'\nnot ok 6\n";}
OpenPOWER on IntegriCloud