diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-12-17 22:49:13 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-12-17 22:49:13 +0000 |
commit | 72d299dbc059aa8efc323c19d871615d0e98af51 (patch) | |
tree | 1319ddb1dd05aca22cad2ab9869f9bbc3ae0d947 /t | |
parent | d6f4130bee95821de6f880b7b61b65d959061959 (diff) | |
download | perl-72d299dbc059aa8efc323c19d871615d0e98af51.tar.gz |
integrate changes#7069..7077,7079,7081..7087,7090,7092,7093,
7096..7104,7109..7117,7119..7124,7126,7128,7129,7133,7134,
7136..7139,7141..7146,7148,7149,7151,7153..7155,7157,7158,
7160,7161,7164,7165,7169..7178,7180..7191,7193..7197,7199,
7201,7204 from mainline
Remove vestiges of tr//CU.
Subject: [ID 20000912.009] perlunicode.pod still mentions tr///CU
Subject: Re: [ID 20000912.009] perlunicode.pod still mentions tr///CU
The return value of setlocale must be copied away.
Subject: [ID 20000913.001] Heap corruption in Perl_init_i18nl10n
Allow chop() and chomp() to be overridden.
Subject: [PATCH] Re: [ID 20000911.006] I can override glob but not chop?
Hints optimization.
Subject: Minor nit
Subject: [PATCH] de-wall t/README
Subject: Re: Two advertising clauses need to be removed
Batch of UTF-8 patches from Simon Cozens.
Fix for a parsing bug, not for the original bug.
Subject: Re: [ID 20000910.005] Another segfault with regexes.
Compilation warnings and an error.
Subject: File::Find 5.7.0 POD nits
Subject: [PATCH perl-5.7.0] continued -Wformat support
The one that got away.
Subject: Re: perl@7078
UTF8-encoded version of 256 is 0xc4 0x80; test that a char is
convertable to bytes by checking it doesn't go above 0xc3
Subject: Re: perl@7078
Replace #7084 with
Subject: Re: perl@7078
We don't need to count the high bit bytes, a boolean is enough.
Subject: [PATCH] utf8.c apidoc
Subject: Re: perl@7078
Botched the #7090 check-in.
Fix for the charnames.t failures from Spider Boardman.
Re-instate Perl_utf8_to_uv without checking parameter - added in change 7075.
i.e. rename Simon's function to Perl_utf8_to_uv_chk, change all calls to it
to use new name and add Perl_utf8_to_uv() as a wrapper which calls it passing
0 to checking to get the warning.
Subject: [PATCH] Nits in perlmod.pod
Subject: Re: Trapping by opmask sets strange parser state [PATCH]
Subject: Re: unicode support and perl [ID 20000901.097]
Subject: Re: unicode support and perl [ID 20000901.097]
Subject: [PATCH perl@7065] another VMS my_fwrite() fix for Storable
Subject: [PATCH] Re: [ID 20000915.010] Infinite loop with -MO=Deparse
Subject: [ID 20000917.002] 5.7.0 and blead@7095 make html makes man
Subject: [PATCH@blead] Fix some recursion in overload.pm
s/Robin Parker/Robin Barker/
Subject: [PATCH] Fix aliasing of tied filehandles
Subject: Re: [ID 20000912.008] substr replacement of tainted data (bug)
Subject: Re: [PATCH 5.005_64 missed]
SOCK_DGRAM and listen() do not mix as reported in
Subject: [ID 20000930.001] Bug in perl 5.00503 IO::Socket
The patch for 5.7.0+ had to be reengineered, though.
Subject: DOC PATCH 5.6.0
Subject: [PATCH 5.7.0] Minor optimization in re_intuit_start
Document the issue (is not a syntax error, kind of)
Subject: Re: [ID 20000901.011] the list (1,,3) ought to be a syntax error
Subject: [ID 20000928.002] perlcc & ByteCode.pm option mismatch
Did not apply cleanly, manual intervention was needed.
Subject: [PATCH] DLL not restartabke with threaded perl
Inside require() $^S was always left undefined.
Subject: Re: Tiny 2-byte change to fix debugger's eval bug
Subject: [PATCH pod/perlop.pod] Documentation glitch in magic autoincrement.
OpenBSD flags tweak from Todd C. Miller, tweaked some more by Abigail.
Regen headers.
Subject: [PATCH 5.7.0] Epoc update
Introduce NO_ENVIRON_ARRAY (and USE_ENVIRON_ARRAY) defines
as suggested by Olaf Flebbe and Nicholas Clark.
Subject: [ID 20000915.007] Not OK: perl v5.7.0 +DEVEL7092 on os2-64int-ld 2.30 '(UNINSTALLED)'
Misplaced else.
Scale down the VMS message boxes, by Charles Lane.
Fix for ID 20000903.009, workaround at
http://www.xray.mpe.mpg.de/mailing-lists/vmsperl/2000-09/msg00039.html
Subject: [ID 20001003.006] B::Debug not -w clean
Test harness update to sync with the new perlcc,
from Simon Cozens.
One remaining nit less at the VMS mailbox sizing.
Subject: [PATCH: 7131] PWPASSWD problem for passwd less pwd's
It is possible to have no hosts database at all. Pointed out in
Subject: [PATCH: 7131] PWPASSWD problem for passwd less pwd's
Subject: [PATCH 5.7.0] h2xs not working
Subject: [PATCH 5.7.0] h2xs not documenting the created module
Subject: [PATCH] 5.6.0 & 5.7.0 VMS TZ fix for VMS6.2 and earlier
Subject: perlhack.pod Patch for Externals Tools
Subject: [PATCH perlrun.pod] Re: [ID 20000930.002] perlrun nor perldelta mention -s modification
Subject: Re: [PATCH 5.7.0] h2xs not documenting the created module
Enable disabling scripts installation by Configure -Uinstallscripts,
suggested by H. Merijn Brand.
Code around the stat-on-a-pipe-returns-a-mode-of-zero bug
reported several times by Dominic Dunlop, for example in
ID 20000315.008. Patch from Dominic. Patch affects at
least MachTen, and possibly other oldish BSDs. Should not
break non-broken platforms (tested on LinuxPPC).
Regen toc.
Subject: Re: Questions about Tie::Array and perl modules
Bug reported and fix suggested by Philip D Crow <pcrow@hertz.com>.
Patch from Simon Cozens to avoid using utf8 routines in EBCDIC.
Tweak #7153.
IO::Handle->syswrite() did not handle length omission
like CORE::syswrite() does.
Subject: [Fwd] IO::Handle, syswrite and arguments
The original patch from andrew@ugh.net.au.
Also the $ccflags is needed for the C compiler check.
Subject: Configure (check for C-compiler)
Eliminate $Is_VMS code from the test.
Subject: Re: [ID 20001004.005] Not OK: perl v5.7.0 +DEVEL7129 on VMS_AXP V7.1
Fix bug in #7157 (s/cflags/ccflags); moved the -o foo
as the first option of cc/ld because of ultrapicky compilers
(e.g. OS/390 R2.5)
Change the version number of Tie::Handle in the core to 4.0,
the (unrelated) Tie::Handle in CPAN will remain at 3.0.
Subject: Note on Tie::Handle
UTF8ize split() so that the cloned substrings get the UTF8
flag of the original scalar. Problem reported by Simon Cozens.
save_re_context() could reset PL_curcop to freed memory, causing core
dumps in code such as C<use CGI::Carp; use something_that_calls_die;>
Subject: PATCH 5.6 perldebguts grammar cleanup
Add a todo note about overloadable assertions.
on Windows, LoadLibrary() could load an extension DLL multiple
times if forward slashes are used in the path
on Windows, cwd strings in the environment should be of the
form =X:=X:\foo instead of =X=X:\foo\
on Windows, avoid potential exception (could happen if MSVCRT isn't
being used) when closing a socket handle
avoid nonportable example code
Windows9x doesn't support link(), despite what Config.pm
might think
pod nit
Change #7160 had a nasty typo.
Warn about unknown scripts.
Subject: Re: ideas? patches? [PATCH bleadperl]
on Windows, clean targets might not work under some flavors of the shell
tweak for change#7173
Make eq work again with utf8 (disabling the upgrading
should no more be necessary since the copies of the
scalars are upgraded, not the scalars themselves).
Takes care of ID 20001009.001. (The claimed length()
bug in 20001009.001 seems bogus to me.)
Subject: [PATCH: perl@7159] various VMS cleanup issues + CXX configure
Upgrade to CGI.pm 2.74, from Lincoln Stein.
Upgrade to podlators 1.04, from Russ Allbery.
Subject: [PATCH 5.6.0] Re: [ID 20001009.004] SEGV from sprintf in a thread
Quote the temp file name, needed in Win32 because the
default name unfortunately contains spaces, shouldn't
hurt elsewhere.
Subject: FW: perldoc fails if $TEMP contains spaces
Subject: RE: [ID 19990803.001] README.win32 suggestions
Subject: [ID 20000720.004] ExtUtils::MakeMaker finds wrong version of perl
Subject: Re: utf8 concat, mg_get
Subject: [PATCH: perl@7181] perlebcdic.pod updates and corrections
Subject: [PATCH: perl@7181] op/tr tests on OS/390
Subject: [PATCH: perl@7181] ver.t v string tests for os/390
Use the versiononly instead of the installscripts,
retract the changes 7146 and 7147.
Reapply Andy's patch and regen Configure.
Add the test case for #7190, from the original bug report
by Andreas König.
Remove duplicated code.
SvPV() (via mg_get() of sv_2pv()) can update the UTF8ness of the SVs.
restore change#7202
p4raw-link: @7202 on //depot/perl: c3fbb29af1dd039d12fa65f0dc334e804a3883fc
p4raw-link: @7173 on //depot/perl: a10b7b7eee64efea010bfdba91243503341ba68d
p4raw-link: @7087 on //depot/perl: b6b716fe3a82a1de9cf94c1d43c790a87a9ece17
p4raw-link: @7081 on //depot/perl: d2560b705d852dbc96fd94b95faaa076758b7a8c
p4raw-link: @7079 on //depot/perl: f10e15646b76a57d224bd131f4c70a7a72147171
p4raw-link: @7077 on //depot/perl: 00df9076cdf35146bc1b44c688065deb7ae6b3ae
p4raw-link: @7069 on //depot/perl: 383e7cdd17eec132ddb7b17dd6275f3153cbe989
p4raw-id: //depot/maint-5.6/perl@8156
p4raw-integrated: from //depot/perl@8153 'copy in' epoc/epoc_stubs.c
epoc/link.pl (@4782..) ext/IO/lib/IO/Socket/UNIX.pm (@4860..)
lib/File/Copy.pm (@5349..) ext/DynaLoader/dl_dlopen.xs
(@5384..) util.h (@6347..) epoc/createpkg.pl (@6363..) pp.sym
pp_proto.h (@6434..) lib/AutoLoader.pm (@6456..)
pod/perldata.pod (@6548..) ext/B/B/Bytecode.pm (@6763..)
ext/ByteLoader/bytecode.h (@6859..) hints/os2.sh (@6873..)
t/lib/cgi-form.t t/op/substr.t t/op/tiehandle.t t/pragma/subs.t
(@6874..) opcode.h (@7016..) lib/Tie/Handle.pm (@7022..)
Todo-5.6 (@7068..) epoc/epocish.h (@7124..) vms/vmsish.h
(@7126..)
p4raw-integrated: from //depot/perl@7204 'edit in' mg.c (@7203..)
p4raw-integrated: from //depot/perl@7201 'copy in' t/pragma/utf8.t
(@7197..) 'edit in' pp_hot.c (@7200..)
p4raw-integrated: from //depot/perl@7199 'copy in' t/lib/cgi-html.t
(@7184..)
p4raw-integrated: from //depot/perl@7196 'copy in' INSTALL
Porting/Glossary Porting/config.sh epoc/config.sh installperl
vos/config.def win32/config.bc win32/config.gc win32/config.vc
(@7195..) 'edit in' Configure Makefile.SH (@7195..) 'ignore'
config_h.SH (@7195..)
p4raw-integrated: from //depot/perl@7195 'copy in' Porting/config_H
(@7146..)
p4raw-integrated: from //depot/perl@7194 'copy in' t/op/ver.t (@6874..)
p4raw-integrated: from //depot/perl@7193 'merge in' t/op/tr.t (@6874..)
p4raw-integrated: from //depot/perl@7191 'copy in' pod/perlebcdic.pod
(@7001..)
p4raw-integrated: from //depot/perl@7189 'copy in'
lib/ExtUtils/MM_Unix.pm (@7054..)
p4raw-integrated: from //depot/perl@7188 'copy in' README.win32
(@6021..)
p4raw-integrated: from //depot/perl@7187 'copy in' utils/perldoc.PL
(@6887..)
p4raw-integrated: from //depot/perl@7186 'copy in' t/lib/thr5005.t
(@6874..) 'edit in' util.c (@7126..)
p4raw-integrated: from //depot/perl@7185 'copy in' lib/Pod/Man.pm
lib/Pod/Text.pm (@7047..)
p4raw-integrated: from //depot/perl@7184 'copy in' lib/CGI.pm (@6722..)
p4raw-integrated: from //depot/perl@7183 'copy in' configure.com
vms/descrip_mms.template (@7058..) vms/vms.c (@7142..)
p4raw-integrated: from //depot/perl@7182 'edit in' sv.c (@7163..)
p4raw-integrated: from //depot/perl@7181 'copy in' win32/win32sck.c
(@7173..)
p4raw-integrated: from //depot/perl@7180 'merge in' win32/Makefile
win32/makefile.mk (@6737..)
p4raw-integrated: from //depot/perl@7178 'copy in' lib/charnames.pm
(@5821..)
p4raw-integrated: from //depot/perl@7176 'copy in' pod/perlport.pod
(@6917..)
p4raw-integrated: from //depot/perl@7175 'copy in'
lib/ExtUtils/Manifest.pm (@4954..)
p4raw-integrated: from //depot/perl@7173 'copy in' win32/win32.h
(@6939..) win32/win32.c (@7171..)
p4raw-integrated: from //depot/perl@7172 'copy in' win32/vdir.h
(@6318..)
p4raw-integrated: from //depot/perl@7169 'copy in' pod/perldebguts.pod
(@7114..)
p4raw-integrated: from //depot/perl@7165 'edit in' pp_ctl.c (@7156..)
p4raw-integrated: from //depot/perl@7164 'edit in' pp.c (@7096..)
p4raw-integrated: from //depot/perl@7158 'copy in' t/lib/b.t (@6874..)
p4raw-integrated: from //depot/perl@7155 'copy in'
ext/IO/lib/IO/Handle.pm (@6553..)
p4raw-integrated: from //depot/perl@7154 'copy in' utf8.h (@7153..)
p4raw-integrated: from //depot/perl@7151 'copy in' lib/Tie/Array.pm
(@5507..) t/op/array.t (@5989..)
p4raw-integrated: from //depot/perl@7149 'copy in' pod/perltoc.pod
(@7001..)
p4raw-integrated: from //depot/perl@7148 'copy in' doio.c (@6532..)
p4raw-integrated: from //depot/perl@7145 'copy in' utils/h2xs.PL
(@7141..)
p4raw-integrated: from //depot/perl@7144 'copy in' pod/perlrun.pod
(@6547..)
p4raw-integrated: from //depot/perl@7143 'copy in' pod/perlhack.pod
(@6922..)
p4raw-integrated: from //depot/perl@7138 'edit in' pp_sys.c (@7124..)
p4raw-integrated: from //depot/perl@7136 'copy in' t/UTEST (@4092..)
t/TEST (@7064..)
p4raw-integrated: from //depot/perl@7134 'copy in' ext/B/B/Debug.pm
(@4546..)
p4raw-integrated: from //depot/perl@7128 'copy in' os2/os2ish.h
(@6915..)
p4raw-integrated: from //depot/perl@7126 'edit in' perl.h (@7124..)
'merge in' unixish.h (@6343..)
p4raw-integrated: from //depot/perl@7124 'copy in' epoc/epoc.c
(@4782..) README.epoc (@6363..) lib/Cwd.pm (@6862..) 'edit in'
perl.c (@7119..)
p4raw-integrated: from //depot/perl@7123 'edit in' embed.h
pod/perlapi.pod (@7096..)
p4raw-integrated: from //depot/perl@7122 'copy in' hints/openbsd.sh
(@5868..)
p4raw-integrated: from //depot/perl@7121 'copy in' pod/perlop.pod
(@7027..)
p4raw-integrated: from //depot/perl@7120 'copy in' cop.h (@6909..)
p4raw-integrated: from //depot/perl@7117 'copy in' utils/perlcc.PL
(@6523..)
p4raw-integrated: from //depot/perl@7115 'copy in' regexec.c (@7096..)
p4raw-integrated: from //depot/perl@7112 'copy in' pod/perlxs.pod
(@7061..)
p4raw-integrated: from //depot/perl@7111 'copy in' opcode.pl (@6553..)
'edit in' op.c (@7096..)
p4raw-integrated: from //depot/perl@7109 'merge in' Changes5.6
(@5903..)
p4raw-integrated: from //depot/perl@7104 'copy in' lib/overload.pm
(@7012..) 'merge in' t/pragma/overload.t (@6983..)
p4raw-integrated: from //depot/perl@7103 'merge in' pod/Makefile.SH
(@6714..)
p4raw-integrated: from //depot/perl@7102 'copy in' ext/B/B/Deparse.pm
(@6880..)
p4raw-integrated: from //depot/perl@7100 'copy in' t/op/append.t
(@6719..)
p4raw-integrated: from //depot/perl@7098 'edit in' toke.c (@7096..)
p4raw-integrated: from //depot/perl@7097 'copy in' pod/perlmod.pod
(@6007..)
p4raw-integrated: from //depot/perl@7096 'copy in' handy.h (@7075..)
regcomp.c (@7081..) 'edit in' doop.c (@7075..) perlapi.c utf8.c
(@7087..) embed.pl proto.h (@7091..) 'merge in' global.sym
objXSUB.h (@7016..)
p4raw-integrated: from //depot/perl@7083 'copy in' t/op/bop.t (@6874..)
p4raw-integrated: from //depot/perl@7082 'copy in' lib/File/Find.pm
(@7079..)
p4raw-integrated: from //depot/perl@7081 'copy in' Porting/pumpkin.pod
(@5084..) malloc.c (@5651..) ext/Devel/Peek/Peek.xs (@5716..)
universal.c (@5924..)
Diffstat (limited to 't')
-rwxr-xr-x | t/TEST | 5 | ||||
-rwxr-xr-x | t/UTEST | 5 | ||||
-rwxr-xr-x | t/lib/b.t | 43 | ||||
-rwxr-xr-x | t/lib/cgi-form.t | 19 | ||||
-rwxr-xr-x | t/lib/cgi-html.t | 25 | ||||
-rwxr-xr-x | t/lib/thr5005.t | 17 | ||||
-rwxr-xr-x | t/op/append.t | 10 | ||||
-rwxr-xr-x | t/op/array.t | 15 | ||||
-rwxr-xr-x | t/op/bop.t | 6 | ||||
-rwxr-xr-x | t/op/substr.t | 9 | ||||
-rwxr-xr-x | t/op/tiehandle.t | 18 | ||||
-rwxr-xr-x | t/op/tr.t | 11 | ||||
-rwxr-xr-x | t/op/ver.t | 88 | ||||
-rwxr-xr-x | t/pragma/overload.t | 16 | ||||
-rwxr-xr-x | t/pragma/subs.t | 24 | ||||
-rwxr-xr-x | t/pragma/utf8.t | 81 |
16 files changed, 301 insertions, 91 deletions
@@ -90,9 +90,10 @@ EOT open(RESULTS,"./perl$switch $test |") or print "can't run.\n"; } else { - open(RESULTS, "./perl -I../lib ../utils/perlcc ./$test " - ."-run -verbose dcf -log ../compilelog |") + open(RESULTS, "./perl -I../lib ../utils/perlcc -o ./$test.plc ./$test " + ." && ./$test.plc |") or print "can't compile.\n"; + unlink "./$test.plc"; } $ok = 0; @@ -81,7 +81,10 @@ EOT if ($type eq 'perl') { open(RESULTS, "./$test |") || (print "can't run.\n"); } else { - open(RESULTS, "./perl -I../lib ../utils/perlcc ./$test -run -verbose dcf -log ../compilelog |") or print "can't compile.\n"; + open(RESULTS, "./perl -I../lib ../utils/perlcc -o ./$test.plc ./$test " + ." && ./$test.plc |") + or print "can't compile.\n"; + unlink "./$test.plc"; } } else { @@ -55,13 +55,7 @@ ok; my $a; my $Is_VMS = $^O eq 'VMS'; -if ($Is_VMS) { - $^X = "MCR $^X"; - $a = `$^X "-I../lib" "-MO=Deparse" -anle "1"`; -} -else { - $a = `$^X -I../lib -MO=Deparse -anle 1 2>&1`; -} +$a = `$^X "-I../lib" "-MO=Deparse" -anle 1 2>&1`; $a =~ s/-e syntax OK\n//g; $b = <<'EOF'; @@ -79,33 +73,18 @@ print "# [$a]\n\# vs\n# [$b]\nnot " if $a ne $b; ok; #6 -if ($Is_VMS) { - $a = `$^X "-I../lib" "-MO=Debug" -e "1"`; -} -else { - $a = `$^X -I../lib -MO=Debug -e 1 2>&1`; -} +$a = `$^X "-I../lib" "-MO=Debug" -e 1 2>&1`; print "not " unless $a =~ /\bLISTOP\b.*\bOP\b.*\bCOP\b.*\bOP\b/s; ok; #7 -if ($Is_VMS) { - $a = `$^X "-I../lib" "-MO=Terse" -e "1"`; -} -else { - $a = `$^X -I../lib -MO=Terse -e 1 2>&1`; -} +$a = `$^X "-I../lib" "-MO=Terse" -e 1 2>&1`; print "not " unless $a =~ /\bLISTOP\b.*leave.*\bOP\b.*enter.*\bCOP\b.*nextstate.*\bOP\b.*null/s; ok; -if ($Is_VMS) { - $a = `$^X "-I../lib" "-MO=Terse" -ane "s/foo/bar/"`; -} -else { - $a = `$^X -I../lib -MO=Terse -ane "s/foo/bar/" 2>&1`; -} +$a = `$^X "-I../lib" "-MO=Terse" -ane "s/foo/bar/" 2>&1`; $a =~ s/\(0x[^)]+\)//g; $a =~ s/\[[^\]]+\]//g; $a =~ s/-e syntax OK//; @@ -133,12 +112,7 @@ $b =~ s/\s+$//; print "# [$a]\n# vs\n# [$b]\nnot " if $a ne $b; ok; -if ($Is_VMS) { - chomp($a = `$^X "-I../lib" "-MB::Stash" "-Mwarnings" -e "1"`); -} -else { - chomp($a = `$^X -I../lib -MB::Stash -Mwarnings -e1`); -} +chomp($a = `$^X "-I../lib" "-MB::Stash" "-Mwarnings" -e1`); $a = join ',', sort split /,/, $a; $a =~ s/-uWin32,// if $^O eq 'MSWin32'; $a =~ s/-u(Cwd|File|File::Copy|OS2),//g if $^O eq 'os2'; @@ -155,12 +129,7 @@ if ($Config{static_ext} eq ' ') { if ($is_thread) { print "# use5005threads: test $test skipped\n"; } else { - if ($Is_VMS) { - $a = `$^X "-I../lib" "-MO=Showlex" -e "my %one"`; - } - else { - $a = `$^X -I../lib -MO=Showlex -e "my %one" 2>&1`; - } + $a = `$^X "-I../lib" "-MO=Showlex" -e "my %one" 2>&1`; print "# [$a]\nnot " unless $a =~ /sv_undef.*PVNV.*%one.*sv_undef.*HV/s; } ok; diff --git a/t/lib/cgi-form.t b/t/lib/cgi-form.t index 7d02181918..6bdd7dec53 100755 --- a/t/lib/cgi-form.t +++ b/t/lib/cgi-form.t @@ -34,8 +34,8 @@ $ENV{SERVER_PROTOCOL} = 'HTTP/1.0'; $ENV{SERVER_PORT} = 8080; $ENV{SERVER_NAME} = 'the.good.ship.lollypop.com'; -test(2,start_form(-action=>'foobar',-method=>GET) eq - qq(<form method="GET" action="foobar" enctype="application/x-www-form-urlencoded">\n), +test(2,start_form(-action=>'foobar',-method=>'get') eq + qq(<form method="get" action="foobar" enctype="application/x-www-form-urlencoded">\n), "start_form()"); test(3,submit() eq qq(<input type="submit" name=".submit" />),"submit()"); @@ -51,32 +51,31 @@ test(10,checkbox(-name=>'weather',-value=>'nice',-label=>'forecast') eq qq(<input type="checkbox" name="weather" value="nice" />forecast), "checkbox()"); test(11,checkbox(-name=>'weather',-value=>'nice',-label=>'forecast',-checked=>1,-override=>1) eq - qq(<input type="checkbox" name="weather" value="nice" checked="yes" />forecast), + qq(<input type="checkbox" name="weather" value="nice" checked />forecast), "checkbox()"); test(12,checkbox(-name=>'weather',-value=>'dull',-label=>'forecast') eq - qq(<input type="checkbox" name="weather" value="dull" checked="yes" />forecast), + qq(<input type="checkbox" name="weather" value="dull" checked />forecast), "checkbox()"); test(13,radio_group(-name=>'game') eq - qq(<input type="radio" name="game" value="chess" checked="yes" />chess <input type="radio" name="game" value="checkers" />checkers), + qq(<input type="radio" name="game" value="chess" checked />chess <input type="radio" name="game" value="checkers" />checkers), 'radio_group()'); test(14,radio_group(-name=>'game',-labels=>{'chess'=>'ping pong'}) eq - qq(<input type="radio" name="game" value="chess" checked="yes" />ping pong <input type="radio" name="game" value="checkers" />checkers), + qq(<input type="radio" name="game" value="chess" checked />ping pong <input type="radio" name="game" value="checkers" />checkers), 'radio_group()'); test(15, checkbox_group(-name=>'game',-Values=>[qw/checkers chess cribbage/]) eq - qq(<input type="checkbox" name="game" value="checkers" checked="yes" />checkers <input type="checkbox" name="game" value="chess" checked="yes" />chess <input type="checkbox" name="game" value="cribbage" />cribbage), + qq(<input type="checkbox" name="game" value="checkers" checked />checkers <input type="checkbox" name="game" value="chess" checked />chess <input type="checkbox" name="game" value="cribbage" />cribbage), 'checkbox_group()'); test(16, checkbox_group(-name=>'game',-values=>[qw/checkers chess cribbage/],-defaults=>['cribbage'],-override=>1) eq - qq(<input type="checkbox" name="game" value="checkers" />checkers <input type="checkbox" name="game" value="chess" />chess <input type="checkbox" name="game" value="cribbage" checked="yes" />cribbage), + qq(<input type="checkbox" name="game" value="checkers" />checkers <input type="checkbox" name="game" value="chess" />chess <input type="checkbox" name="game" value="cribbage" checked />cribbage), 'checkbox_group()'); - test(17, popup_menu(-name=>'game',-values=>[qw/checkers chess cribbage/],-default=>'cribbage',-override=>1) eq <<END,'checkbox_group()'); <select name="game"> <option value="checkers">checkers</option> <option value="chess">chess</option> -<option selected="yes" value="cribbage">cribbage</option> +<option selected value="cribbage">cribbage</option> </select> END diff --git a/t/lib/cgi-html.t b/t/lib/cgi-html.t index 2d71ff6a77..50c840816b 100755 --- a/t/lib/cgi-html.t +++ b/t/lib/cgi-html.t @@ -17,6 +17,15 @@ print "ok 1\n"; ######################### End of black magic. +my $CRLF = "\015\012"; +if ($^O eq 'VMS') { + $CRLF = "\n"; # via web server carriage is inserted automatically +} +if (ord("\t") != 9) { # EBCDIC? + $CRLF = "\r\n"; +} + + # util sub test { local($^W) = 0; @@ -24,14 +33,6 @@ sub test { print($true ? "ok $num\n" : "not ok $num $msg\n"); } -my $CRLF = "\015\012"; -if ($^O eq 'VMS') { - $CRLF = "\n"; # via web server carriage is inserted automatically -} -if (ord("\t") != 9) { # EBCDIC? - $CRLF = "\r\n"; -} - # all the automatic tags test(2,h1() eq '<h1 />',"single tag"); test(3,h1('fred') eq '<h1>fred</h1>',"open/close tag"); @@ -50,7 +51,7 @@ test(10,header(-type=>'image/gif') eq "Content-Type: image/gif${CRLF}${CRLF}","h test(11,header(-type=>'image/gif',-status=>'500 Sucks') eq "Status: 500 Sucks${CRLF}Content-Type: image/gif${CRLF}${CRLF}","header()"); test(12,header(-nph=>1) eq "HTTP/1.0 200 OK${CRLF}Content-Type: text/html; charset=ISO-8859-1${CRLF}${CRLF}","header()"); test(13,start_html() ."\n" eq <<END,"start_html()"); -<!DOCTYPE HTML +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"><head><title>Untitled Document</title> @@ -58,14 +59,14 @@ test(13,start_html() ."\n" eq <<END,"start_html()"); END ; test(14,start_html(-dtd=>"-//IETF//DTD HTML 3.2//FR") ."\n" eq <<END,"start_html()"); -<!DOCTYPE HTML +<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 3.2//FR"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"><head><title>Untitled Document</title> </head><body> END ; test(15,start_html(-Title=>'The world of foo') ."\n" eq <<END,"start_html()"); -<!DOCTYPE HTML +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"><head><title>The world of foo</title> @@ -74,7 +75,7 @@ END ; test(16,($cookie=cookie(-name=>'fred',-value=>['chocolate','chip'],-path=>'/')) eq 'fred=chocolate&chip; path=/',"cookie()"); my $h = header(-Cookie=>$cookie); -test(17,$h =~ m!^Set-Cookie: fred=chocolate&chip\; path=/\015\012Date:.*\015\012Content-Type: text/html; charset=ISO-8859-1\015\012\015\012!s, +test(17,$h =~ m!^Set-Cookie: fred=chocolate&chip\; path=/${CRLF}Date:.*${CRLF}Content-Type: text/html; charset=ISO-8859-1${CRLF}${CRLF}!s, "header(-cookie)"); test(18,start_h3 eq '<h3>'); test(19,end_h3 eq '</h3>'); diff --git a/t/lib/thr5005.t b/t/lib/thr5005.t index 057a08fe7d..680e1af3e7 100755 --- a/t/lib/thr5005.t +++ b/t/lib/thr5005.t @@ -13,7 +13,7 @@ BEGIN { $ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3; } $| = 1; -print "1..21\n"; +print "1..22\n"; use Thread 'yield'; print "ok 1\n"; @@ -89,6 +89,18 @@ my $long = "This is short."; my $longe = " short."; my $thr1 = new Thread \&threaded, $short, $shorte, "19"; my $thr2 = new Thread \&threaded, $long, $longe, "20"; +my $thr3 = new Thread \&testsprintf, "21"; + +sub testsprintf { + my $testno = shift; + # this may coredump if thread vars are not properly initialised + my $same = sprintf "%.0f", $testno; + if ($testno eq $same) { + print "ok $testno\n"; + } else { + print "not ok $testno\t# '$testno' ne '$same'\n"; + } +} sub threaded { my ($string, $string_end, $testno) = @_; @@ -115,4 +127,5 @@ EOT } $thr1->join; $thr2->join; -print "ok 21\n"; +$thr3->join; +print "ok 22\n"; diff --git a/t/op/append.t b/t/op/append.t index afaf6a1d41..972d32178b 100755 --- a/t/op/append.t +++ b/t/op/append.t @@ -2,7 +2,7 @@ # $RCSfile: append.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:36 $ -print "1..13\n"; +print "1..14\n"; $a = 'ab' . 'c'; # compile time $b = 'def'; @@ -54,3 +54,11 @@ if ($_ eq 'abcdef') {print "ok 3\n";} else {print "not ok 3\n";} my $t8 = $u; $t8 = $ub . $t8; print $t8 =~ /b/ ? "ok 13\n" : "not ok 13\t# $t8\n"; } + +# test that undef left and right of utf8 results in a valid string +{ + my $a; + $a .= "\x{1ff}"; + print $a eq "\x{1ff}" ? "ok 14\n" : + "not ok 14\t# (undef.0x1ff) ne (0x1ff)\n"; +} diff --git a/t/op/array.t b/t/op/array.t index 97a4a40c3f..7cc84e3217 100755 --- a/t/op/array.t +++ b/t/op/array.t @@ -1,6 +1,6 @@ #!./perl -print "1..66\n"; +print "1..70\n"; # # @foo, @bar, and @ary are also used from tie-stdarray after tie-ing them @@ -216,3 +216,16 @@ reify('ok'); print "not " unless qw(foo bar snorfle)[2] eq 'snorfle'; print "ok 66\n"; +@ary = (12,23,34,45,56); + +print "not " unless shift(@ary) == 12; +print "ok 67\n"; + +print "not " unless pop(@ary) == 56; +print "ok 68\n"; + +print "not " unless push(@ary,56) == 4; +print "ok 69\n"; + +print "not " unless unshift(@ary,12) == 5; +print "ok 70\n"; diff --git a/t/op/bop.t b/t/op/bop.t index 8279abae2d..92baa67bd9 100755 --- a/t/op/bop.t +++ b/t/op/bop.t @@ -82,9 +82,9 @@ print "ok 28\n" if sprintf("%vd", v4095.801.4095 & v801.4095) eq '801.801'; print "ok 29\n" if sprintf("%vd", v4095.801.4095 | v801.4095) eq '4095.4095.4095'; print "ok 30\n" if sprintf("%vd", v801.4095 ^ v4095.801.4095) eq '3294.3294.4095'; # -print "ok 31\n" if sprintf("%vd", v120.v300 & v200.v400) eq '72.256'; -print "ok 32\n" if sprintf("%vd", v120.v300 | v200.v400) eq '248.444'; -print "ok 33\n" if sprintf("%vd", v120.v300 ^ v200.v400) eq '176.188'; +print "ok 31\n" if sprintf("%vd", v120.v300 & v200.400) eq '72.256'; +print "ok 32\n" if sprintf("%vd", v120.v300 | v200.400) eq '248.444'; +print "ok 33\n" if sprintf("%vd", v120.v300 ^ v200.400) eq '176.188'; # my $a = v120.300; my $b = v200.400; diff --git a/t/op/substr.t b/t/op/substr.t index 891e9041a7..4d3bbce927 100755 --- a/t/op/substr.t +++ b/t/op/substr.t @@ -1,6 +1,6 @@ #!./perl -print "1..135\n"; +print "1..136\n"; #P = start of string Q = start of substr R = end of substr S = end of string @@ -297,3 +297,10 @@ ok 125, $a eq 'xxxxefgh'; ok 134, length($z) == 5; ok 135, $z eq "21\x{263a}10"; } + +# replacement should work on magical values +require Tie::Scalar; +my %data; +tie $data{'a'}, 'Tie::StdScalar'; # makes $data{'a'} magical +$data{a} = "firstlast"; +ok 136, substr($data{'a'}, 0, 5, "") eq "first" && $data{'a'} eq "last"; diff --git a/t/op/tiehandle.t b/t/op/tiehandle.t index d7e6a78baf..b04bdb7897 100755 --- a/t/op/tiehandle.t +++ b/t/op/tiehandle.t @@ -77,7 +77,7 @@ package main; use Symbol; -print "1..29\n"; +print "1..33\n"; my $fh = gensym; @@ -149,3 +149,19 @@ ok($data eq "qwerty"); @expect = (CLOSE => $ob); $r = close $fh; ok($r == 5); + +# Does aliasing work with tied FHs? +*ALIAS = *$fh; +@expect = (PRINT => $ob,"some","text"); +$r = print ALIAS @expect[2,3]; +ok($r == 1); + +{ + use warnings; + # Special case of aliasing STDERR, which used + # to dump core when warnings were enabled + *STDERR = *$fh; + @expect = (PRINT => $ob,"some","text"); + $r = print STDERR @expect[2,3]; + ok($r == 1); +} @@ -59,11 +59,18 @@ print "ok 6\n"; print "not " if $x ne 256.65.258 or length $x != 3; print "ok 7\n"; $x =~ tr/A/B/; -print "not " if $x ne 256.66.258 or length $x != 3; +if (ord("\t") == 9) { # ASCII + print "not " if $x ne 256.66.258 or length $x != 3; +} +else { + print "not " if $x ne 256.65.258 or length $x != 3; +} print "ok 8\n"; { -use utf8; +if (ord("\t") == 9) { # ASCII + use utf8; +} # 9 - changing UTF8 characters in a UTF8 string, same length. $l = chr(300); $r = chr(400); diff --git a/t/op/ver.t b/t/op/ver.t index 63cb7164dd..08beced092 100755 --- a/t/op/ver.t +++ b/t/op/ver.t @@ -14,13 +14,24 @@ require v5.5.640; print "ok $test\n"; ++$test; # printing characters should work -print v111; -print v107.32; -print "$test\n"; ++$test; - -# hash keys too -$h{v111.107} = "ok"; -print "$h{ok} $test\n"; ++$test; +if (ord("\t") == 9) { # ASCII + print v111; + print v107.32; + print "$test\n"; ++$test; + + # hash keys too + $h{v111.107} = "ok"; + print "$h{ok} $test\n"; ++$test; +} +else { # EBCDIC + print v150; + print v146.64; + print "$test\n"; ++$test; + + # hash keys too + $h{v150.146} = "ok"; + print "$h{ok} $test\n"; ++$test; +} # poetry optimization should also sub v77 { "ok" } @@ -28,7 +39,12 @@ $x = v77; print "$x $test\n"; ++$test; # but not when dots are involved -$x = v77.78.79; +if (ord("\t") == 9) { # ASCII + $x = v77.78.79; +} +else { + $x = v212.213.214; +} print "not " unless $x eq "MNO"; print "ok $test\n"; ++$test; @@ -42,10 +58,20 @@ require 5.5.640; print "ok $test\n"; ++$test; # hash keys too -$h{111.107.32} = "ok"; +if (ord("\t") == 9) { # ASCII + $h{111.107.32} = "ok"; +} +else { + $h{150.146.64} = "ok"; +} print "$h{ok } $test\n"; ++$test; -$x = 77.78.79; +if (ord("\t") == 9) { # ASCII + $x = 77.78.79; +} +else { + $x = 212.213.214; +} print "not " unless $x eq "MNO"; print "ok $test\n"; ++$test; @@ -53,19 +79,34 @@ print "not " unless 1.20.300.4000 eq "\x{1}\x{14}\x{12c}\x{fa0}"; print "ok $test\n"; ++$test; # test sprintf("%vd"...) etc -print "not " unless sprintf("%vd", "Perl") eq '80.101.114.108'; +if (ord("\t") == 9) { # ASCII + print "not " unless sprintf("%vd", "Perl") eq '80.101.114.108'; +} +else { + print "not " unless sprintf("%vd", "Perl") eq '215.133.153.147'; +} print "ok $test\n"; ++$test; print "not " unless sprintf("%vd", v1.22.333.4444) eq '1.22.333.4444'; print "ok $test\n"; ++$test; -print "not " unless sprintf("%vx", "Perl") eq '50.65.72.6c'; +if (ord("\t") == 9) { # ASCII + print "not " unless sprintf("%vx", "Perl") eq '50.65.72.6c'; +} +else { + print "not " unless sprintf("%vx", "Perl") eq 'd7.85.99.93'; +} print "ok $test\n"; ++$test; print "not " unless sprintf("%vX", 1.22.333.4444) eq '1.16.14D.115C'; print "ok $test\n"; ++$test; -print "not " unless sprintf("%*v#o", ":", "Perl") eq '0120:0145:0162:0154'; +if (ord("\t") == 9) { # ASCII + print "not " unless sprintf("%*v#o", ":", "Perl") eq '0120:0145:0162:0154'; +} +else { + print "not " unless sprintf("%*v#o", ":", "Perl") eq '0327:0205:0231:0223'; +} print "ok $test\n"; ++$test; print "not " unless sprintf("%*vb", "##", v1.22.333.4444) @@ -79,20 +120,35 @@ print "ok $test\n"; ++$test; { use bytes; - print "not " unless sprintf("%vd", "Perl") eq '80.101.114.108'; + if (ord("\t") == 9) { # ASCII + print "not " unless sprintf("%vd", "Perl") eq '80.101.114.108'; + } + else { + print "not " unless sprintf("%vd", "Perl") eq '215.133.153.147'; + } print "ok $test\n"; ++$test; print "not " unless sprintf("%vd", 1.22.333.4444) eq '1.22.197.141.225.133.156'; print "ok $test\n"; ++$test; - print "not " unless sprintf("%vx", "Perl") eq '50.65.72.6c'; + if (ord("\t") == 9) { # ASCII + print "not " unless sprintf("%vx", "Perl") eq '50.65.72.6c'; + } + else { + print "not " unless sprintf("%vx", "Perl") eq 'd7.85.99.93'; + } print "ok $test\n"; ++$test; print "not " unless sprintf("%vX", v1.22.333.4444) eq '1.16.C5.8D.E1.85.9C'; print "ok $test\n"; ++$test; - print "not " unless sprintf("%*v#o", ":", "Perl") eq '0120:0145:0162:0154'; + if (ord("\t") == 9) { # ASCII + print "not " unless sprintf("%*v#o", ":", "Perl") eq '0120:0145:0162:0154'; + } + else { + print "not " unless sprintf("%*v#o", ":", "Perl") eq '0327:0205:0231:0223'; + } print "ok $test\n"; ++$test; print "not " unless sprintf("%*vb", "##", v1.22.333.4444) diff --git a/t/pragma/overload.t b/t/pragma/overload.t index d13626b04e..aa6f3c1b02 100755 --- a/t/pragma/overload.t +++ b/t/pragma/overload.t @@ -969,5 +969,19 @@ unless ($aaa) { test($a =~ /^`1' is not a code reference at/); # 215 } +# make sure that we don't inifinitely recurse +{ + my $c = 0; + package Recurse; + use overload '""' => sub { shift }, + '0+' => sub { shift }, + 'bool' => sub { shift }, + fallback => 1; + my $x = bless([]); + main::test("$x" =~ /Recurse=ARRAY/); # 216 + main::test($x); # 217 + main::test($x+0 =~ /Recurse=ARRAY/); # 218 +}; + # Last test is: -sub last {215} +sub last {218} diff --git a/t/pragma/subs.t b/t/pragma/subs.t index cebb635d60..7e48e201a8 100755 --- a/t/pragma/subs.t +++ b/t/pragma/subs.t @@ -114,6 +114,30 @@ EXPECT 3 ######## +# override a built-in function, call after definition +use subs qw( open ) ; +sub open { print $_[0] + $_[1], "\n" } +open 1,2 ; +EXPECT +3 +######## + +# override a built-in function, call with () +use subs qw( open ) ; +open (1,2) ; +sub open { print $_[0] + $_[1], "\n" } +EXPECT +3 +######## + +# override a built-in function, call with () after definition +use subs qw( open ) ; +sub open { print $_[0] + $_[1], "\n" } +open (1,2) ; +EXPECT +3 +######## + --FILE-- abc Fred 1,2 ; 1; diff --git a/t/pragma/utf8.t b/t/pragma/utf8.t index 1d0bef798e..2b208cc167 100755 --- a/t/pragma/utf8.t +++ b/t/pragma/utf8.t @@ -10,7 +10,7 @@ BEGIN { } } -print "1..66\n"; +print "1..75\n"; my $test = 1; @@ -20,6 +20,12 @@ sub ok { print "ok $test\n"; } +sub nok { + my ($got,$expect) = @_; + print "# expected not [$expect], got [$got]\nnot " if $got eq $expect; + print "ok $test\n"; +} + sub ok_bytes { use bytes; my ($got,$expect) = @_; @@ -27,6 +33,12 @@ sub ok_bytes { print "ok $test\n"; } +sub nok_bytes { + use bytes; + my ($got,$expect) = @_; + print "# expected not [$expect], got [$got]\nnot " if $got eq $expect; + print "ok $test\n"; +} { use utf8; @@ -295,3 +307,70 @@ sub ok_bytes { ok_bytes chr(0xe2), pack("C*", 0xc3, 0xa2); $test++; # 66 } + +{ + use utf8; + my @a = map ord, split(//, join("", map chr, (1234, 123, 2345))); + ok "@a", "1234 123 2345"; + $test++; # 67 +} + +{ + use utf8; + my $x = chr(123); + my @a = map ord, split(/$x/, join("", map chr, (1234, 123, 2345))); + ok "@a", "1234 2345"; + $test++; # 68 +} + +{ + my($a,$b); + { use bytes; $a = "\xc3\xa4"; } + { use utf8; $b = "\xe4"; } + { use bytes; ok_bytes $a, $b; $test++; } # 69 + { use utf8; nok $a, $b; $test++; } # 70 +} + +{ + my @x = ("stra\337e 138","stra\337e 138"); + for (@x) { + s/(\d+)\s*([\w\-]+)/$1 . uc $2/e; + my($latin) = /^(.+)(?:\s+\d)/; + print $latin eq "stra\337e" ? "ok $test\n" : + "#latin[$latin]\nnot ok $test\n"; + $test++; + $latin =~ s/stra\337e/straße/; # \303\237 after the 2nd a + use utf8; + $latin =~ s!(s)tr(?:aß|s+e)!$1tr.!; # \303\237 after the a + } +} + +{ + $_ = $dx = "\x{10f2}"; + s/($dx)/$dx$1/; + { + use bytes; + print "not " unless $_ eq "$dx$dx"; + print "ok $test\n"; + $test++; + } + + $_ = $dx = "\x{10f2}"; + s/($dx)/$1$dx/; + { + use bytes; + print "not " unless $_ eq "$dx$dx"; + print "ok $test\n"; + $test++; + } + + $dx = "\x{10f2}"; + $_ = "\x{10f2}\x{10f2}"; + s/($dx)($dx)/$1$2/; + { + use bytes; + print "not " unless $_ eq "$dx$dx"; + print "ok $test\n"; + $test++; + } +} |