From: Rafael Garcia-Suarez Date: Fri, 29 Aug 2003 21:17:59 +0000 (+0000) Subject: Add a new test, to ensure that we don't unexpectedly change X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c022218576a859aaf45ee04ac6beca35d37620fc;p=p5sagit%2Fp5-mst-13.2.git Add a new test, to ensure that we don't unexpectedly change prototypes of builtins. p4raw-id: //depot/perl@20940 --- diff --git a/MANIFEST b/MANIFEST index 53e08f9..c75aa5e 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2692,6 +2692,7 @@ t/op/cmp.t See if the various string and numeric compare work t/op/concat.t See if string concatenation works t/op/cond.t See if conditional expressions work t/op/context.t See if context propagation works +t/op/cproto.t Check builtin prototypes t/op/crypt.t See if crypt works t/op/defins.t See if auto-insert of defined() works t/op/delete.t See if delete works diff --git a/t/op/cproto.t b/t/op/cproto.t new file mode 100644 index 0000000..26850c0 --- /dev/null +++ b/t/op/cproto.t @@ -0,0 +1,256 @@ +#!./perl +# Tests to ensure that we don't unexpectedly change prototypes of builtins + +use Test::More tests => 234; +while () { + chomp; + my ($keyword, $proto) = split; + if ($proto eq 'undef') { + ok( !defined prototype "CORE::".$keyword, $keyword ); + } + elsif ($proto eq 'unknown') { + eval { prototype "CORE::".$keyword }; + like( $@, qr/Can't find an opnumber for/, $keyword ); + } + else { + is( "(".prototype("CORE::".$keyword).")", $proto, $keyword ); + } +} + +# the keyword list : + +__DATA__ +abs (;$) +accept (**) +alarm (;$) +and () +atan2 ($$) +bind (*$) +binmode (*;$) +bless ($;$) +caller (;$) +chdir (;$) +chmod (@) +chomp undef +chop undef +chown (@) +chr (;$) +chroot (;$) +close (;*) +closedir (*) +cmp unknown +connect (*$) +continue unknown +cos (;$) +crypt ($$) +dbmclose (\%) +dbmopen (\%$$) +defined undef +delete undef +die (@) +do undef +dump () +each (\%) +else undef +elsif undef +endgrent () +endhostent () +endnetent () +endprotoent () +endpwent () +endservent () +eof (;*) +eq ($$) +err unknown +eval undef +exec undef +exists undef +exit (;$) +exp (;$) +fcntl (*$$) +fileno (*) +flock (*$) +for undef +foreach undef +fork () +format undef +formline ($@) +ge ($$) +getc (;*) +getgrent () +getgrgid ($) +getgrnam ($) +gethostbyaddr ($$) +gethostbyname ($) +gethostent () +getlogin () +getnetbyaddr ($$) +getnetbyname ($) +getnetent () +getpeername (*) +getpgrp (;$) +getppid () +getpriority ($$) +getprotobyname ($) +getprotobynumber ($) +getprotoent () +getpwent () +getpwnam ($) +getpwuid ($) +getservbyname ($$) +getservbyport ($$) +getservent () +getsockname (*) +getsockopt (*$$) +glob undef +gmtime (;$) +goto undef +grep undef +gt ($$) +hex (;$) +if undef +index ($$;$) +int (;$) +ioctl (*$$) +join ($@) +keys (\%) +kill (@) +last undef +lc (;$) +lcfirst (;$) +le ($$) +length (;$) +link ($$) +listen (*$) +local undef +localtime (;$) +lock (\$) +log (;$) +lstat (*) +lt ($$) +m undef +map undef +mkdir ($;$) +msgctl ($$$) +msgget ($$) +msgrcv ($$$$$) +msgsnd ($$$) +my undef +ne ($$) +next undef +no undef +not ($) +oct (;$) +open (*;$@) +opendir (*$) +or () +ord (;$) +our undef +pack ($@) +package undef +pipe (**) +pop (;\@) +pos undef +print undef +printf undef +prototype undef +push (\@@) +q undef +qq undef +qr undef +quotemeta (;$) +qw undef +qx undef +rand (;$) +read (*\$$;$) +readdir (*) +readline (;*) +readlink (;$) +readpipe unknown +recv (*\$$$) +redo undef +ref (;$) +rename ($$) +require undef +reset (;$) +return undef +reverse (@) +rewinddir (*) +rindex ($$;$) +rmdir (;$) +s undef +scalar undef +seek (*$$) +seekdir (*$) +select (;*) +semctl ($$$$) +semget ($$$) +semop ($$) +send (*$$;$) +setgrent () +sethostent ($) +setnetent ($) +setpgrp undef +setpriority ($$$) +setprotoent ($) +setpwent () +setservent ($) +setsockopt (*$$$) +shift (;\@) +shmctl ($$$) +shmget ($$$) +shmread ($$$$) +shmwrite ($$$$) +shutdown (*$) +sin (;$) +sleep (;$) +socket (*$$$) +socketpair (**$$$) +sort undef +splice (\@;$$@) +split undef +sprintf ($@) +sqrt (;$) +srand (;$) +stat (*) +study undef +sub undef +substr ($$;$$) +symlink ($$) +syscall ($@) +sysopen (*$$;$) +sysread (*\$$;$) +sysseek (*$$) +system undef +syswrite (*$;$$) +tell (;*) +telldir (*) +tie undef +tied undef +time () +times () +tr undef +truncate ($$) +uc (;$) +ucfirst (;$) +umask (;$) +undef undef +unless undef +unlink (@) +unpack ($;$) +unshift (\@@) +untie undef +until undef +use undef +utime (@) +values (\%) +vec ($$$) +wait () +waitpid ($$) +wantarray () +warn (@) +while undef +write (;*) +x unknown +xor ($$) +y undef