diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-06-07 20:16:23 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-06-07 20:28:39 -0700 |
commit | 01b5ef509f2ebf466fd7de2c1e7406717bb14332 (patch) | |
tree | 5dbd28d948e2a7f1bd8030b4a0e69016391490d0 /t | |
parent | 1cb2b5d4ff78efbd407ee199ed0ed9ff0227cecb (diff) | |
download | perl-01b5ef509f2ebf466fd7de2c1e7406717bb14332.tar.gz |
[perl #24482] Fix sort and require to treat CORE:: as keyword
Diffstat (limited to 't')
-rw-r--r-- | t/comp/require.t | 11 | ||||
-rw-r--r-- | t/op/sort.t | 6 |
2 files changed, 15 insertions, 2 deletions
diff --git a/t/comp/require.t b/t/comp/require.t index ac711321be..475388fe05 100644 --- a/t/comp/require.t +++ b/t/comp/require.t @@ -34,7 +34,7 @@ if (grep -e, @files_to_delete) { my $Is_EBCDIC = (ord('A') == 193) ? 1 : 0; my $Is_UTF8 = (${^OPEN} || "") =~ /:utf8/; -my $total_tests = 54; +my $total_tests = 55; if ($Is_EBCDIC || $Is_UTF8) { $total_tests -= 3; } print "1..$total_tests\n"; @@ -211,6 +211,15 @@ if($@ =~ /Can't locate threads in \@INC/) { print "not ok - RT #24404$i\n"; } +# require CORE::foo +eval ' require CORE::lc "THREADS" '; +$i++; +if($@ =~ /Can't locate threads in \@INC/) { + print "ok $i - [perl #24482] require CORE::foo\n"; +} else { + print "not ok - [perl #24482] require CORE::foo\n"; +} + write_file('bleah.pm', qq(die "This is an expected error";\n)); delete $INC{"bleah.pm"}; ++$::i; diff --git a/t/op/sort.t b/t/op/sort.t index 03d2ce1c69..ca749a063b 100644 --- a/t/op/sort.t +++ b/t/op/sort.t @@ -6,7 +6,7 @@ BEGIN { require 'test.pl'; } use warnings; -plan( tests => 176 ); +plan( tests => 177 ); # these shouldn't hang { @@ -119,6 +119,10 @@ cmp_ok("@b",'eq','1 2 3 4','map then sort'); cmp_ok("@b",'eq','1 2 3 4','reverse then sort'); +@b = sort CORE::reverse (4,1,3,2); +cmp_ok("@b",'eq','1 2 3 4','CORE::reverse then sort'); + + sub twoface { no warnings 'redefine'; *twoface = sub { $a <=> $b }; &twoface } eval { @b = sort twoface 4,1,3,2 }; |