In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/f3b02925aeacaac5636cac62dc3bf78525fdbe3d?hp=158ba8927e4a5389414871fefc9fe63835a11682>
- Log ----------------------------------------------------------------- commit f3b02925aeacaac5636cac62dc3bf78525fdbe3d Author: Nicholas Clark <[email protected]> Date: Sat Mar 5 22:49:29 2011 +0000 Skip regexp_unicode_prop.t under minitest, as File::Spec may not be available. It uses charnames, which uses File::Spec->file_name_is_absolute(). As regexp_unicode_prop.t now requires test.pl, switch to using $::IS_EBCDIC, which test.pl sets. M t/re/regexp_unicode_prop.t commit 0669fd04b735fd4b6a986ced1b0c4fb536fc05e5 Author: Nicholas Clark <[email protected]> Date: Sat Mar 5 22:36:15 2011 +0000 Skip pat_re_eval.t in minitest, as it uses re, which needs dynamic loading. M t/re/pat_re_eval.t commit 5c0a530f531c4c1d760edf76bbc9ed69672e15e2 Author: Nicholas Clark <[email protected]> Date: Fri Feb 25 15:56:04 2011 +0000 Move two tests using charnames from t/re/pat.t to pat_rt_report.t The latter is skipped under minitest, as C<re> may not be available. charnames may also fail to load under minitest, if File::Spec has not been built. t/re/pat.t should now always run (and pass) under minitest. M t/re/pat.t M t/re/pat_rt_report.t commit 4fd7f5ff8da050d88e61e334c715394bb9403e9e Author: Nicholas Clark <[email protected]> Date: Fri Feb 25 15:54:15 2011 +0000 In fold_grind.t, move the use charnames; after the skip_all_if_miniperl(). This test isn't run under minitest, but use charnames; may well fail before that skip is encountered, if it fails to load File::Spec. Moving it after the BEGIN block ensures that the test will always run, or skip cleanly. M t/re/fold_grind.t commit 14f86f07ade34600128ccb86ef97cf6415278acd Author: Nicholas Clark <[email protected]> Date: Fri Feb 25 15:53:10 2011 +0000 Skip reg_eval_scope.t under minitest, as it needs charnames. Charnames uses File::Spec, which may not have been build. M t/re/reg_eval_scope.t commit 632e037a5753f74d4e3c88cf452d9953b8579fd3 Author: Nicholas Clark <[email protected]> Date: Fri Feb 25 14:59:55 2011 +0000 Skip taint.t and lex_utf8.t under minitest, as both require C<re>. M t/op/taint.t M t/uni/lex_utf8.t commit 164766b20b2667cd7984ecaf094dcaba9a39117f Author: Nicholas Clark <[email protected]> Date: Fri Feb 25 14:58:58 2011 +0000 Skip reg_fold.t under minitest, as it uses charnames, which uses File::Spec. M t/re/reg_fold.t commit 293c724a53dc74a7494606f694c008cbca5ca490 Author: Nicholas Clark <[email protected]> Date: Fri Feb 25 14:57:57 2011 +0000 Skip a block of ref.t's tests on minitest, as C<re> may not be available. M t/op/ref.t commit f6e0b6da787118ff6d715e369cab0cb72038366d Author: Nicholas Clark <[email protected]> Date: Fri Feb 25 14:56:20 2011 +0000 Correct the skip count for t/op/switch.t under minitest. Skip this section unconditionally under miniperl, rather than assuming that Scalar::Util will fall back to a pure perl version if "installed" in lib/, but dynamic loading is unavailable. M t/op/switch.t commit 0f77baf62a0c7e94e448aeceaad28c256c525344 Author: Nicholas Clark <[email protected]> Date: Fri Feb 25 14:01:43 2011 +0000 Fix magic.t's expectation for $^X under minitest when the OS makes $^X absolute Under minitest, t/perl is a symlink to ../perl. Test scripts are invoked with ./perl. When $Config{d_procselfexe} is undefined, $^X is still ./perl. When it is defined, the OS resolves it to the absolute path .../miniperl. Fix t/op/magic.t to be aware of this. Previously it was working for all cases other than [$Config{d_procselfexe} is defined] and [make minitest] and [perl does not exist]. M t/op/magic.t commit 519ecd2cabd84d9e11d438f376f05f932f9bc5cc Author: Nicholas Clark <[email protected]> Date: Thu Feb 24 10:06:35 2011 +0000 In t/ avoid using File::Spec for paths only used by Perl. All platforms Perl builds on can already support Unix-style paths (given that make_ext.pl is using them). This makes 7 more tests pass under minitest, which doesn't build File::Spec, because it's part of an XS module. M t/io/fs.t M t/op/readline.t M t/run/switchx.t M t/uni/case.pl M t/uni/fold.t commit 0e25fa04f6006646c337dfe00daeec3d9906506f Author: Nicholas Clark <[email protected]> Date: Sun Mar 6 09:12:19 2011 +0000 Refactor t/op/time.t to use test.pl's warning_is(). M t/op/time.t ----------------------------------------------------------------------- Summary of changes: t/io/fs.t | 3 +-- t/op/magic.t | 5 ++--- t/op/readline.t | 7 +++---- t/op/ref.t | 5 +++-- t/op/switch.t | 3 +-- t/op/taint.t | 3 ++- t/op/time.t | 14 ++++---------- t/re/fold_grind.t | 4 ++-- t/re/pat.t | 24 +----------------------- t/re/pat_re_eval.t | 1 + t/re/pat_rt_report.t | 25 ++++++++++++++++++++++++- t/re/reg_eval_scope.t | 7 ++++++- t/re/reg_fold.t | 1 + t/re/regexp_unicode_prop.t | 11 +++++++---- t/run/switchx.t | 7 +++---- t/uni/case.pl | 6 +----- t/uni/fold.t | 5 +---- t/uni/lex_utf8.t | 1 + 18 files changed, 64 insertions(+), 68 deletions(-) diff --git a/t/io/fs.t b/t/io/fs.t index 64fcc5b..1cdddec 100644 --- a/t/io/fs.t +++ b/t/io/fs.t @@ -7,7 +7,6 @@ BEGIN { } use Config; -use File::Spec::Functions; my $Is_VMSish = ($^O eq 'VMS'); @@ -66,7 +65,7 @@ else { `rm -f $tmpdir 2>/dev/null; mkdir $tmpdir 2>/dev/null`; } -chdir catdir(curdir(), $tmpdir); +chdir $tmpdir; `/bin/rm -rf a b c x` if -x '/bin/rm'; diff --git a/t/op/magic.t b/t/op/magic.t index 6c9f95e..403cba7 100644 --- a/t/op/magic.t +++ b/t/op/magic.t @@ -193,7 +193,7 @@ like ($@, qr/^Modification of a read-only value attempted/); else { $wd = '.'; } - my $perl = $Is_VMS ? $^X : "$wd/perl"; + my $perl = $Is_VMS || $Config{d_procselfexe} ? $^X : "$wd/perl"; my $headmaybe = ''; my $middlemaybe = ''; my $tailmaybe = ''; @@ -237,7 +237,7 @@ EOH $s1 = "\$^X is $perl, \$0 is $script\n"; ok open(SCRIPT, ">$script") or diag "Can't write to $script: $!"; ok print(SCRIPT $headmaybe . <<EOB . $middlemaybe . <<'EOF' . $tailmaybe) or diag $!; -#!$wd/perl +#!$perl EOB print "\$^X is $^X, \$0 is $0\n"; EOF @@ -246,7 +246,6 @@ EOF $_ = $Is_VMS ? `$perl $script` : `$script`; s/\.exe//i if $Is_Dos or $Is_Cygwin or $Is_os2; s{./$script}{$script} if $Is_BeOS; # revert BeOS execvp() side-effect - s{\bminiperl\b}{perl}; # so that test doesn't fail with miniperl s{is perl}{is $perl}; # for systems where $^X is only a basename s{\\}{/}g; if ($Is_MSWin32 || $Is_os2) { diff --git a/t/op/readline.t b/t/op/readline.t index d2c2c6f..81ac9e0 100644 --- a/t/op/readline.t +++ b/t/op/readline.t @@ -61,9 +61,8 @@ foreach my $l (1, 21) { } use strict; -use File::Spec; -open F, File::Spec->curdir and sysread F, $_, 1; +open F, '.' and sysread F, $_, 1; my $err = $! + 0; close F; @@ -71,13 +70,13 @@ SKIP: { skip "you can read directories as plain files", 2 unless( $err ); $!=0; - open F, File::Spec->curdir and $_=<F>; + open F, '.' and $_=<F>; ok( $!==$err && !defined($_) => 'readline( DIRECTORY )' ); close F; $!=0; { local $/; - open F, File::Spec->curdir and $_=<F>; + open F, '.' and $_=<F>; ok( $!==$err && !defined($_) => 'readline( DIRECTORY ) slurp mode' ); close F; } diff --git a/t/op/ref.t b/t/op/ref.t index 0f6a7a5..ab1fe5c 100644 --- a/t/op/ref.t +++ b/t/op/ref.t @@ -7,7 +7,6 @@ BEGIN { } use strict qw(refs subs); -use re (); plan(213); @@ -136,7 +135,9 @@ sub mysub2 { lc shift } # Test REGEXP assignment -{ +SKIP: { + skip_if_miniperl("no dynamic loading on miniperl, so can't load re", 5); + require re; my $x = qr/x/; my $str = "$x"; # regex stringification may change diff --git a/t/op/switch.t b/t/op/switch.t index a7123cb..bcf77d4 100644 --- a/t/op/switch.t +++ b/t/op/switch.t @@ -784,8 +784,7 @@ sub contains_x { } SKIP: { - skip "Scalar/Util.pm not yet available", 20 - unless -r "$INC[0]/Scalar/Util.pm"; + skip_if_miniperl("no dynamic loading on miniperl, no Scalar::Util", 14); # Test overloading { package OverloadTest; diff --git a/t/op/taint.t b/t/op/taint.t index fbbe2a0..af51d95 100644 --- a/t/op/taint.t +++ b/t/op/taint.t @@ -10,12 +10,13 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; + require './test.pl'; + skip_all_if_miniperl("no dynamic loading on miniperl, no re"); } use strict; use Config; -BEGIN { require './test.pl'; } plan tests => 766; $| = 1; diff --git a/t/op/time.t b/t/op/time.t index 7db8ee8..4ac7f5b 100644 --- a/t/op/time.t +++ b/t/op/time.t @@ -140,16 +140,10 @@ ok(gmtime() =~ /^(Sun|Mon|Tue|Wed|Thu|Fri|Sat)[ ] # Test floating point args { - eval { - $SIG{__WARN__} = sub { die @_; }; - is( (localtime(1296000.23))[5] + 1900, 1970 ); - }; - is($@, '', 'Ignore fractional time'); - eval { - $SIG{__WARN__} = sub { die @_; }; - is( (gmtime(1.23))[5] + 1900, 1970 ); - }; - is($@, '', 'Ignore fractional time'); + warning_is(sub {is( (localtime(1296000.23))[5] + 1900, 1970 )}, + undef, 'Ignore fractional time'); + warning_is(sub {is( (gmtime(1.23))[5] + 1900, 1970 )}, + undef, 'Ignore fractional time'); } diff --git a/t/re/fold_grind.t b/t/re/fold_grind.t index 33adebd..5a8a7b4 100644 --- a/t/re/fold_grind.t +++ b/t/re/fold_grind.t @@ -1,7 +1,5 @@ # Grind out a lot of combinatoric tests for folding. -use charnames ":full"; - binmode STDOUT, ":utf8"; BEGIN { @@ -11,6 +9,8 @@ BEGIN { skip_all_if_miniperl("no dynamic loading on miniperl, no Encode nor POSIX"); } +use charnames ":full"; + my $DEBUG = 0; # Outputs extra information for debugging this .t use strict; diff --git a/t/re/pat.t b/t/re/pat.t index e453327..3b170c8 100644 --- a/t/re/pat.t +++ b/t/re/pat.t @@ -21,7 +21,7 @@ BEGIN { require './test.pl'; } -plan tests => 455; # Update this when adding/deleting tests. +plan tests => 449; # Update this when adding/deleting tests. run_tests() unless caller; @@ -992,28 +992,6 @@ sub run_tests { } { - use charnames ":full"; - # Delayed interpolation of \N' - my $r1 = qr/\N{THAI CHARACTER SARA I}/; - my $s1 = "\x{E34}\x{E34}\x{E34}\x{E34}"; - - # Bug #56444 - ok $s1 =~ /$r1+/, 'my $r1 = qr/\N{THAI CHARACTER SARA I}/; my $s1 = "\x{E34}\x{E34}\x{E34}\x{E34}; $s1 =~ /$r1+/'; - - # Bug #62056 - ok "${s1}A" =~ m/$s1\N{LATIN CAPITAL LETTER A}/, '"${s1}A" =~ m/$s1\N{LATIN CAPITAL LETTER A}/'; - - ok "abbbbc" =~ m/\N{1}/ && $& eq "a", '"abbbbc" =~ m/\N{1}/ && $& eq "a"'; - ok "abbbbc" =~ m/\N{3,4}/ && $& eq "abbb", '"abbbbc" =~ m/\N{3,4}/ && $& eq "abbb"'; - } - - { - use charnames ":full"; - my $message = '[perl #74982] Period coming after \N{}'; - ok("\x{ff08}." =~ m/\N{FULLWIDTH LEFT PARENTHESIS}./ && $& eq "\x{ff08}.", $message); - ok("\x{ff08}." =~ m/[\N{FULLWIDTH LEFT PARENTHESIS}]./ && $& eq "\x{ff08}.", $message); - } - { my $n= 50; # this must be a high number and go from 0 to N, as the bug we are looking for doesn't # seem to be predictable. Slight changes to the test make it fail earlier or later. diff --git a/t/re/pat_re_eval.t b/t/re/pat_re_eval.t index a9ccbe7..20bc7b3 100644 --- a/t/re/pat_re_eval.t +++ b/t/re/pat_re_eval.t @@ -18,6 +18,7 @@ BEGIN { chdir 't' if -d 't'; @INC = ('../lib','.'); require './test.pl'; + skip_all_if_miniperl("no dynamic loading on miniperl, no re"); } diff --git a/t/re/pat_rt_report.t b/t/re/pat_rt_report.t index ea4e6bc..c0a0ec7 100644 --- a/t/re/pat_rt_report.t +++ b/t/re/pat_rt_report.t @@ -22,7 +22,7 @@ BEGIN { } -plan tests => 2514; # Update this when adding/deleting tests. +plan tests => 2520; # Update this when adding/deleting tests. run_tests() unless caller; @@ -1098,6 +1098,29 @@ sub run_tests { 'stclass optimisation does not break + inside (?=); Bug 68564'); } + { + use charnames ":full"; + # Delayed interpolation of \N' + my $r1 = qr/\N{THAI CHARACTER SARA I}/; + my $s1 = "\x{E34}\x{E34}\x{E34}\x{E34}"; + + # Bug #56444 + ok $s1 =~ /$r1+/, 'my $r1 = qr/\N{THAI CHARACTER SARA I}/; my $s1 = "\x{E34}\x{E34}\x{E34}\x{E34}; $s1 =~ /$r1+/'; + + # Bug #62056 + ok "${s1}A" =~ m/$s1\N{LATIN CAPITAL LETTER A}/, '"${s1}A" =~ m/$s1\N{LATIN CAPITAL LETTER A}/'; + + ok "abbbbc" =~ m/\N{1}/ && $& eq "a", '"abbbbc" =~ m/\N{1}/ && $& eq "a"'; + ok "abbbbc" =~ m/\N{3,4}/ && $& eq "abbb", '"abbbbc" =~ m/\N{3,4}/ && $& eq "abbb"'; + } + + { + use charnames ":full"; + my $message = '[perl #74982] Period coming after \N{}'; + ok("\x{ff08}." =~ m/\N{FULLWIDTH LEFT PARENTHESIS}./ && $& eq "\x{ff08}.", $message); + ok("\x{ff08}." =~ m/[\N{FULLWIDTH LEFT PARENTHESIS}]./ && $& eq "\x{ff08}.", $message); + } + } # End of sub run_tests 1; diff --git a/t/re/reg_eval_scope.t b/t/re/reg_eval_scope.t index 3fd1bad..43af443 100644 --- a/t/re/reg_eval_scope.t +++ b/t/re/reg_eval_scope.t @@ -2,7 +2,12 @@ # Test scoping issues with embedded code in regexps. -BEGIN { chdir 't'; @INC = qw "lib ../lib"; require './test.pl' } +BEGIN { + chdir 't'; + @INC = qw(lib ../lib); + require './test.pl'; + skip_all_if_miniperl("no dynamic loading on miniperl, no re"); +} plan 17; diff --git a/t/re/reg_fold.t b/t/re/reg_fold.t index 59dbfc7..318f816 100644 --- a/t/re/reg_fold.t +++ b/t/re/reg_fold.t @@ -4,6 +4,7 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; require './test.pl'; + skip_all_if_miniperl("no dynamic loading on miniperl, no File::Spec"); } use strict; diff --git a/t/re/regexp_unicode_prop.t b/t/re/regexp_unicode_prop.t index 017d3de..ee65dbd 100644 --- a/t/re/regexp_unicode_prop.t +++ b/t/re/regexp_unicode_prop.t @@ -8,7 +8,10 @@ use strict; use warnings; use 5.010; -my $IS_EBCDIC = ord ('A') == 193; +BEGIN { + require './test.pl'; + skip_all_if_miniperl("no dynamic loading on miniperl, no File::Spec (used by charnames)"); +} sub run_tests; @@ -61,8 +64,8 @@ my @CLASSES = ( # It's ok to repeat class names. # InLatin1Supplement => - $IS_EBCDIC ? ['!\x{7f}', '\x{80}', '!\x{100}'] - : ['!\x{7f}', '\x{80}', '\x{ff}', '!\x{100}'], + $::IS_EBCDIC ? ['!\x{7f}', '\x{80}', '!\x{100}'] + : ['!\x{7f}', '\x{80}', '\x{ff}', '!\x{100}'], InLatinExtendedA => ['!\x{7f}', '!\x{80}', '!\x{ff}', '\x{100}'], @@ -153,7 +156,7 @@ while (my ($class, $chars) = each %SHORT_PROPERTIES) { ? $_ : "!$_"} @$chars; } -delete $d {IsASCII} if $IS_EBCDIC; +delete $d {IsASCII} if $::IS_EBCDIC; push @CLASSES => "# Short properties" => %SHORT_PROPERTIES, "# POSIX like properties" => %d, diff --git a/t/run/switchx.t b/t/run/switchx.t index 1c61ba8..75dd50d 100644 --- a/t/run/switchx.t +++ b/t/run/switchx.t @@ -6,15 +6,14 @@ BEGIN { } require './test.pl'; -use File::Spec::Functions; # Test '-x' print runperl( switches => ['-x'], - progfile => catfile(curdir(), 'run', 'switchx.aux') ); + progfile => 'run/switchx.aux' ); # Test '-xdir' -print runperl( switches => ['-x' . catfile(curdir(), 'run')], - progfile => catfile(curdir(), 'run', 'switchx2.aux'), +print runperl( switches => ['-x./run'], + progfile => 'run/switchx2.aux', args => [ 3 ] ); # EOF diff --git a/t/uni/case.pl b/t/uni/case.pl index fcb43de..8a2f752 100644 --- a/t/uni/case.pl +++ b/t/uni/case.pl @@ -1,5 +1,3 @@ -use File::Spec; - require "test.pl"; sub unidump { @@ -22,9 +20,7 @@ sub casetest { }, )} @funcs; - my $file = File::Spec->catfile(File::Spec->catdir(File::Spec->updir, - "lib", "unicore", "To"), - "$base.pl"); + my $file = "../lib/unicore/To/$base.pl"; my $simple = do $file or die $@; my %simple; for my $i (split(/\n/, $simple)) { diff --git a/t/uni/fold.t b/t/uni/fold.t index a8cd384..d481b53 100644 --- a/t/uni/fold.t +++ b/t/uni/fold.t @@ -11,15 +11,12 @@ BEGIN { binmode *STDOUT, ":utf8"; -use File::Spec; our $TODO; plan("no_plan"); # Read in the official case folding definitions. -my $CF = File::Spec->catfile(File::Spec->catdir(File::Spec->updir, - "lib", "unicore"), - "CaseFolding.txt"); +my $CF = '../lib/unicore/CaseFolding.txt'; die qq[$0: failed to open "$CF": $!\n] if ! open(my $fh, "<", $CF); diff --git a/t/uni/lex_utf8.t b/t/uni/lex_utf8.t index 2aa9221..a5747cb 100644 --- a/t/uni/lex_utf8.t +++ b/t/uni/lex_utf8.t @@ -10,6 +10,7 @@ BEGIN { $| = 1; require './test.pl'; + skip_all_if_miniperl("no dynamic loading on miniperl, no re"); } use strict; -- Perl5 Master Repository
