summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1999-02-07 18:05:13 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1999-02-07 18:05:13 +0000
commitbdbd2f2228a5f903eac5af514b0686141570617f (patch)
treed69d0d2dd25cbb69594f6a6ed3bc0f9111280959 /t
parentf27fa58d3bdcde5eed9604e8af9c14b89a02d8ab (diff)
parent1ae175c8d48ec3f9bff4739583753d9b46939a5f (diff)
downloadperl-bdbd2f2228a5f903eac5af514b0686141570617f.tar.gz
Integrate from mainperl.
p4raw-id: //depot/cfgperl@2825
Diffstat (limited to 't')
-rwxr-xr-xt/comp/bproto.t41
1 files changed, 41 insertions, 0 deletions
diff --git a/t/comp/bproto.t b/t/comp/bproto.t
new file mode 100755
index 0000000000..699ea57a36
--- /dev/null
+++ b/t/comp/bproto.t
@@ -0,0 +1,41 @@
+#!./perl
+#
+# check if builtins behave as prototyped
+#
+
+BEGIN {
+ chdir 't' if -d 't';
+ unshift @INC, '../lib';
+}
+
+print "1..7\n";
+
+my $i = 1;
+
+sub foo {}
+my $bar = "bar";
+
+sub test_too_many {
+ eval $_[0];
+ print "not " unless $@ =~ /^Too many arguments/;
+ printf "ok %d\n",$i++;
+}
+
+sub test_no_error {
+ eval $_[0];
+ print "not " if $@;
+ printf "ok %d\n",$i++;
+}
+
+test_too_many($_) for split /\n/,
+q[ defined(&foo, $bar);
+ undef(&foo, $bar);
+ uc($bar,$bar);
+];
+
+test_no_error($_) for split /\n/,
+q[ scalar(&foo,$bar);
+ defined &foo, &foo, &foo;
+ undef &foo, $bar;
+ uc $bar,$bar;
+];