summaryrefslogtreecommitdiffstats
path: root/contrib/perl5/t/op/args.t
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2000-06-25 11:04:01 +0000
committermarkm <markm@FreeBSD.org>2000-06-25 11:04:01 +0000
commit2618fad5bbb2d0182eb31ed805c41b543c513940 (patch)
tree52ba93338b13aefd02a0055304a9eccfa0e049f5 /contrib/perl5/t/op/args.t
parent77644ee620b6a79cf8c538abaf7cd301a875528d (diff)
downloadFreeBSD-src-2618fad5bbb2d0182eb31ed805c41b543c513940.zip
FreeBSD-src-2618fad5bbb2d0182eb31ed805c41b543c513940.tar.gz
Vendor import of Perl 5.006
Diffstat (limited to 'contrib/perl5/t/op/args.t')
-rwxr-xr-xcontrib/perl5/t/op/args.t54
1 files changed, 54 insertions, 0 deletions
diff --git a/contrib/perl5/t/op/args.t b/contrib/perl5/t/op/args.t
new file mode 100755
index 0000000..48bf5afe
--- /dev/null
+++ b/contrib/perl5/t/op/args.t
@@ -0,0 +1,54 @@
+#!./perl
+
+print "1..8\n";
+
+# test various operations on @_
+
+my $ord = 0;
+sub new1 { bless \@_ }
+{
+ my $x = new1("x");
+ my $y = new1("y");
+ ++$ord;
+ print "# got [@$y], expected [y]\nnot " unless "@$y" eq "y";
+ print "ok $ord\n";
+ ++$ord;
+ print "# got [@$x], expected [x]\nnot " unless "@$x" eq "x";
+ print "ok $ord\n";
+}
+
+sub new2 { splice @_, 0, 0, "a", "b", "c"; return \@_ }
+{
+ my $x = new2("x");
+ my $y = new2("y");
+ ++$ord;
+ print "# got [@$x], expected [a b c x]\nnot " unless "@$x" eq "a b c x";
+ print "ok $ord\n";
+ ++$ord;
+ print "# got [@$y], expected [a b c y]\nnot " unless "@$y" eq "a b c y";
+ print "ok $ord\n";
+}
+
+sub new3 { goto &new1 }
+{
+ my $x = new3("x");
+ my $y = new3("y");
+ ++$ord;
+ print "# got [@$y], expected [y]\nnot " unless "@$y" eq "y";
+ print "ok $ord\n";
+ ++$ord;
+ print "# got [@$x], expected [x]\nnot " unless "@$x" eq "x";
+ print "ok $ord\n";
+}
+
+sub new4 { goto &new2 }
+{
+ my $x = new4("x");
+ my $y = new4("y");
+ ++$ord;
+ print "# got [@$x], expected [a b c x]\nnot " unless "@$x" eq "a b c x";
+ print "ok $ord\n";
+ ++$ord;
+ print "# got [@$y], expected [a b c y]\nnot " unless "@$y" eq "a b c y";
+ print "ok $ord\n";
+}
OpenPOWER on IntegriCloud