diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2006-03-28 18:49:48 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2006-03-28 18:49:48 +0000 |
commit | cbd32a74205d498c321a7b857f5688e91b79a46a (patch) | |
tree | 8471eee5f0c8bffea7e82f37290595729af41bd8 /gnu | |
parent | 7a2de971ddb5bf81bb8c69616b1b0fc4d140bd60 (diff) |
perl 5.8.8 import
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/perl/lib/Pod/t/htmllink.pod | 6 | ||||
-rwxr-xr-x | gnu/usr.bin/perl/lib/Pod/t/htmllink.t | 75 | ||||
-rw-r--r-- | gnu/usr.bin/perl/pod/perlglossary.pod | 31 | ||||
-rwxr-xr-x | gnu/usr.bin/perl/t/op/threads.t | 206 |
4 files changed, 56 insertions, 262 deletions
diff --git a/gnu/usr.bin/perl/lib/Pod/t/htmllink.pod b/gnu/usr.bin/perl/lib/Pod/t/htmllink.pod index db2f98402bf..2113db7462c 100644 --- a/gnu/usr.bin/perl/lib/Pod/t/htmllink.pod +++ b/gnu/usr.bin/perl/lib/Pod/t/htmllink.pod @@ -92,17 +92,15 @@ This is section three. =over 4 -=item item1 X<item> X<one> +=item item1 This is item one. =item item 2 -X<item> X<two> This is item two. -=item item three X<item> -X<three> +=item item three This is item three. diff --git a/gnu/usr.bin/perl/lib/Pod/t/htmllink.t b/gnu/usr.bin/perl/lib/Pod/t/htmllink.t index ab1179656af..27142e698b5 100755 --- a/gnu/usr.bin/perl/lib/Pod/t/htmllink.t +++ b/gnu/usr.bin/perl/lib/Pod/t/htmllink.t @@ -10,24 +10,23 @@ BEGIN { use strict; use Test::More tests => 1; -convert_n_test("htmllink", "html links"); +TODO: { + local $TODO = "item 2 doesn't work as expected"; + convert_n_test("htmllink", "html links"); +} __DATA__ -<?xml version="1.0" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>htmllink - Test HTML links</title> -<meta http-equiv="content-type" content="text/html; charset=utf-8" /> -<link rev="made" href="mailto:[PERLADMIN]" /> +<link rev="made" href="mailto:" /> </head> <body style="background-color: white"> - -<!-- INDEX BEGIN --> -<div name="index"> <p><a name="__index__"></a></p> +<!-- INDEX BEGIN --> <ul> @@ -42,11 +41,9 @@ __DATA__ </ul> </ul> - -<hr name="index" /> -</div> <!-- INDEX END --> +<hr /> <p> </p> <h1><a name="name">NAME</a></h1> @@ -58,39 +55,39 @@ __DATA__ <p><a href="#section1">section1</a></p> <p><a href="#section_2">section 2</a></p> <p><a href="#section_three">section three</a></p> -<p><a href="#item1">item1</a></p> -<p><a href="#item_2">item 2</a></p> -<p><a href="#item_three">item three</a></p> +<p><a href="#item_item1">item1</a></p> +<p><a href="#item_item_2">item 2</a></p> +<p><a href="#item_item_three">item three</a></p> <p><a href="#section1">section1</a></p> <p><a href="#section_2">section 2</a></p> <p><a href="#section_three">section three</a></p> -<p><a href="#item1">item1</a></p> -<p><a href="#item_2">item 2</a></p> -<p><a href="#item_three">item three</a></p> +<p><a href="#item_item1">item1</a></p> +<p><a href="#item_item_2">item 2</a></p> +<p><a href="#item_item_three">item three</a></p> <p><a href="#section1">section1</a></p> <p><a href="#section_2">section 2</a></p> <p><a href="#section_three">section three</a></p> -<p><a href="#item1">item1</a></p> -<p><a href="#item_2">item 2</a></p> -<p><a href="#item_three">item three</a></p> +<p><a href="#item_item1">item1</a></p> +<p><a href="#item_item_2">item 2</a></p> +<p><a href="#item_item_three">item three</a></p> <p><a href="#section1">text</a></p> <p><a href="#section_2">text</a></p> <p><a href="#section_three">text</a></p> -<p><a href="#item1">text</a></p> -<p><a href="#item_2">text</a></p> -<p><a href="#item_three">text</a></p> +<p><a href="#item_item1">text</a></p> +<p><a href="#item_item_2">text</a></p> +<p><a href="#item_item_three">text</a></p> <p><a href="#section1">text</a></p> <p><a href="#section_2">text</a></p> <p><a href="#section_three">text</a></p> -<p><a href="#item1">text</a></p> -<p><a href="#item_2">text</a></p> -<p><a href="#item_three">text</a></p> +<p><a href="#item_item1">text</a></p> +<p><a href="#item_item_2">text</a></p> +<p><a href="#item_item_three">text</a></p> <p><a href="#section1">text</a></p> <p><a href="#section_2">text</a></p> <p><a href="#section_three">text</a></p> -<p><a href="#item1">text</a></p> -<p><a href="#item_2">text</a></p> -<p><a href="#item_three">text</a></p> +<p><a href="#item_item1">text</a></p> +<p><a href="#item_item_2">text</a></p> +<p><a href="#item_item_three">text</a></p> <p> </p> <hr /> @@ -108,22 +105,24 @@ __DATA__ <h2><a name="section_three">section three</a></h2> <p>This is section three.</p> <dl> -<dt><strong><a name="item1" class="item">item1</a></strong></dt> - +<dt><strong><a name="item_item1">item1</a></strong><br /> +</dt> <dd> -<p>This is item one.</p> +This is item one. </dd> -<dt><strong><a name="item_2" class="item">item 2</a></strong></dt> - +<p></p> +<dt><strong><a name="item_item_2">item 2</a></strong><br /> +</dt> <dd> -<p>This is item two.</p> +This is item two. </dd> -<dt><strong><a name="item_three" class="item">item three</a></strong></dt> - +<p></p> +<dt><strong><a name="item_item_three">item three</a></strong><br /> +</dt> <dd> -<p>This is item three.</p> +This is item three. </dd> -</dl> +<p></p></dl> </body> diff --git a/gnu/usr.bin/perl/pod/perlglossary.pod b/gnu/usr.bin/perl/pod/perlglossary.pod index b44fcd447f9..b27444023c1 100644 --- a/gnu/usr.bin/perl/pod/perlglossary.pod +++ b/gnu/usr.bin/perl/pod/perlglossary.pod @@ -114,7 +114,7 @@ The American Standard Code for Information Interchange (a 7-bit character set adequate only for poorly representing English text). Often used loosely to describe the lowest 128 values of the various ISO-8859-X character sets, a bunch of mutually incompatible 8-bit -codes sometimes described as half ASCII. See also L</Unicode>. +codes best described as half ASCII. See also L</Unicode>. =item assertion @@ -793,17 +793,6 @@ textual object, not to be confused with a L</separator> or L</terminator>. "To delimit" really just means "to surround" or "to enclose" (like these parentheses are doing). -=item deprecated modules and features - -Deprecated modules and features are those which were part of a stable -release, but later found to be subtly flawed, and which should be avoided. -They are subject to removal and/or bug-incompatible reimplementation in -the next major release (but they will be preserved through maintenance -releases). Deprecation warnings are issued under B<-w> or C<use -diagnostics>, and notices are found in L<perldelta>s, as well as various -other PODs. Coding practices that misuse features, such as C<my $foo if -0>, can also be deprecated. - =item dereference A fancy computer science term meaning "to follow a L</reference> to @@ -873,17 +862,6 @@ A standard, bundled release of a system of software. The default usage implies source code is included. If that is not the case, it will be called a "binary-only" distribution. -=item (to be) dropped modules - -When Perl 5 was first released (see L<perlhistory>), several modules were -included, which have now fallen out of common use. It has been suggested -that these modules should be removed, since the distribution became rather -large, and the common criterion for new module additions is now limited to -modules that help to build, test, and extend perl itself. Furthermore, -the CPAN (which didn't exist at the time of Perl 5.0) can become the new -home of dropped modules. Dropping modules is currently not an option, but -further developments may clear the last barriers. - =item dweomer An enchantment, illusion, phantasm, or jugglery. Said when Perl's @@ -1457,9 +1435,6 @@ invocant between the method and its arguments: give $gollum "Fisssssh!"; give $gollum "Precious!"; -In modern Perl, calling methods this way is often considered bad practice and -to be avoided. - =item indirect object slot The syntactic position falling between a method call and its arguments @@ -1595,7 +1570,7 @@ hold, not to be confused with an L</NV>. "Just Another Perl Hacker," a clever but cryptic bit of Perl code that when executed, evaluates to that string. Often used to illustrate a -particular Perl feature, and something of an ongoing Obfuscated Perl +particular Perl feature, and something of an ungoing Obfuscated Perl Contest seen in Usenix signatures. =back @@ -3223,7 +3198,7 @@ change their meanings.) =item Unicode A character set comprising all the major character sets of the world, -more or less. See L<perlunicode> and L<http://www.unicode.org>. +more or less. See L<http://www.unicode.org>. =item Unix diff --git a/gnu/usr.bin/perl/t/op/threads.t b/gnu/usr.bin/perl/t/op/threads.t index 956102ab156..c89a7528fa8 100755 --- a/gnu/usr.bin/perl/t/op/threads.t +++ b/gnu/usr.bin/perl/t/op/threads.t @@ -1,33 +1,32 @@ -#!perl - +#!./perl BEGIN { chdir 't' if -d 't'; @INC = '../lib'; - require './test.pl'; + require './test.pl'; # for which_perl() etc $| = 1; +} + +use strict; +use Config; - require Config; - if (!$Config::Config{useithreads}) { - print "1..0 # Skip: no ithreads\n"; - exit 0; +BEGIN { + if (!$Config{useithreads}) { + print "1..0 # Skip: no ithreads\n"; + exit 0; } if ($ENV{PERL_CORE_MINITEST}) { print "1..0 # Skip: no dynamic loading on miniperl, no threads\n"; exit 0; } - - plan(18); + plan(3); } - -use strict; -use warnings; use threads; # test that we don't get: # Attempt to free unreferenced scalar: SV 0x40173f3c fresh_perl_is(<<'EOI', 'ok', { }, 'delete() under threads'); use threads; -threads->create(sub { my %h=(1,2); delete $h{1}})->join for 1..2; +threads->new(sub { my %h=(1,2); delete $h{1}})->join for 1..2; print "ok"; EOI @@ -41,7 +40,7 @@ my $data = "a"; my $obj = \$data; my $copy = $obj; Scalar::Util::weaken($copy); -threads->create(sub { 1 })->join for (1..1); +threads->new(sub { 1 })->join for (1..1); print "ok"; EOI @@ -58,183 +57,6 @@ use Scalar::Util qw(weaken); my $object = Foo->new; my $ref = $object; weaken $ref; -threads->create(sub { $ref = $object } )->join; # $ref = $object causes problems -print "ok"; -EOI - -#PR30333 - sort() crash with threads -sub mycmp { length($b) <=> length($a) } - -sub do_sort_one_thread { - my $kid = shift; - print "# kid $kid before sort\n"; - my @list = ( 'x', 'yy', 'zzz', 'a', 'bb', 'ccc', 'aaaaa', 'z', - 'hello', 's', 'thisisalongname', '1', '2', '3', - 'abc', 'xyz', '1234567890', 'm', 'n', 'p' ); - - for my $j (1..99999) { - for my $k (sort mycmp @list) {} - } - print "# kid $kid after sort, sleeping 1\n"; - sleep(1); - print "# kid $kid exit\n"; -} - -sub do_sort_threads { - my $nthreads = shift; - my @kids = (); - for my $i (1..$nthreads) { - my $t = threads->create(\&do_sort_one_thread, $i); - print "# parent $$: continue\n"; - push(@kids, $t); - } - for my $t (@kids) { - print "# parent $$: waiting for join\n"; - $t->join(); - print "# parent $$: thread exited\n"; - } -} - -do_sort_threads(2); # crashes -ok(1); - -# Change 24643 made the mistake of assuming that CvCONST can only be true on -# XSUBs. Somehow it can also end up on perl subs. -fresh_perl_is(<<'EOI', 'ok', { }, 'cloning constant subs'); -use constant x=>1; -use threads; -$SIG{__WARN__} = sub{}; -async sub {}; +threads->new(sub { $ref = $object } )->join; # $ref = $object causes problems print "ok"; EOI - -# From a test case by Tim Bunce in -# http://www.nntp.perl.org/group/perl.perl5.porters/63123 -fresh_perl_is(<<'EOI', 'ok', { }, 'Ensure PL_linestr can be cloned'); -use threads; -print do 'op/threads_create.pl' || die $@; -EOI - - -TODO: { - no strict 'vars'; # Accessing $TODO from test.pl - local $TODO = 'refcount issues with threads'; - -# Scalars leaked: 1 -foreach my $BLOCK (qw(CHECK INIT)) { - fresh_perl_is(<<EOI, 'ok', { }, "threads in $BLOCK block"); - use threads; - $BLOCK { threads->create(sub {})->join; } - print 'ok'; -EOI -} - -} # TODO - -# Scalars leaked: 1 -fresh_perl_is(<<'EOI', 'ok', { }, 'Bug #41138'); - use threads; - leak($x); - sub leak - { - local $x; - threads->create(sub {})->join(); - } - print 'ok'; -EOI - - -# [perl #45053] Memory corruption with heavy module loading in threads -# -# run-time usage of newCONSTSUB (as done by the IO boot code) wasn't -# thread-safe - got occasional coredumps or malloc corruption -{ - local $SIG{__WARN__} = sub {}; # Ignore any thread creation failure warnings - my @t; - for (1..100) { - my $thr = threads->create( sub { require IO }); - last if !defined($thr); # Probably ran out of memory - push(@t, $thr); - } - $_->join for @t; - ok(1, '[perl #45053]'); -} - -sub matchit { - is (ref $_[1], "Regexp"); - like ($_[0], $_[1]); -} - -threads->new(\&matchit, "Pie", qr/pie/i)->join(); - -# tests in threads don't get counted, so -curr_test(curr_test() + 2); - - -# the seen_evals field of a regexp was getting zeroed on clone, so -# within a thread it didn't know that a regex object contrained a 'safe' -# re_eval expression, so it later died with 'Eval-group not allowed' when -# you tried to interpolate the object - -sub safe_re { - my $re = qr/(?{1})/; # this is literal, so safe - eval { "a" =~ /$re$re/ }; # interpolating safe values, so safe - ok($@ eq "", 'clone seen-evals'); -} -threads->new(\&safe_re)->join(); - -# tests in threads don't get counted, so -curr_test(curr_test() + 1); - -# This used to crash in 5.10.0 [perl #64954] - -undef *a; -threads->new(sub {})->join; -pass("undefing a typeglob doesn't cause a crash during cloning"); - - -# Test we don't get: -# panic: del_backref during global destruction. -# when returning a non-closure sub from a thread and subsequently starting -# a new thread. -fresh_perl_is(<<'EOI', 'ok', { }, 'No del_backref panic [perl #70748]'); -use threads; -sub foo { return (sub { }); } -my $bar = threads->create(\&foo)->join(); -threads->create(sub { })->join(); -print "ok"; -EOI - -# Another, more reliable test for the same del_backref bug: -fresh_perl_like( - <<' EOJ', qr/ok/, {}, 'No del_backref panic [perl #70748] (2)' - use threads; - push @bar, threads->create(sub{sub{}})->join() for 1...10; - print "ok"; - EOJ -); - -# Simple closure-returning test: At least this case works (though it -# leaks), and we don't want to break it. -fresh_perl_like(<<'EOJ', qr/^foo\n/, {}, 'returning a closure'); -use threads; -print create threads sub { - my $x = "foo\n"; - sub{sub{$x}} -}=>->join->()() - //"undef" -EOJ - -# At the point of thread creation, $h{1} is on the temps stack. -# The weak reference $a, however, is visible from the symbol table. -fresh_perl_is(<<'EOI', 'ok', { }, 'Test for 34394ecd06e704e9'); - use threads; - %h = (1, 2); - use Scalar::Util 'weaken'; - $a = \$h{1}; - weaken($a); - delete $h{1} && threads->create(sub {}, shift)->join(); - print 'ok'; -EOI - -# EOF |