This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove code in Storable's tests that handles perl < v5.6.1
[perl5.git] / dist / Storable / t / downgrade.t
index 617fb59..43a32ed 100644 (file)
@@ -50,10 +50,8 @@ if ($] > 5.007002) {
   my $a_circumflex = (ord ('A') == 193 ? "\x47" : "\xe5");
   %U_HASH = (map {$_, $_} 'castle', "ch${a_circumflex}teau", $utf8, chr 0x57CE);
   plan tests => 169;
-} elsif ($] >= 5.006) {
-  plan tests => 59;
 } else {
-  plan tests => 67;
+  plan tests => 59;
 }
 
 $UTF8_CROAK = "/^Cannot retrieve UTF8 data in non-UTF8 perl/";
@@ -91,17 +89,7 @@ sub thaw_scalar {
   my $scalar = eval {thaw $tests{$name}};
   is ($@, '', "Thawed $name without error?");
   isa_ok ($scalar, 'SCALAR', "Thawed $name?");
-  if ($bug and $] == 5.006) {
-    # Aargh. <expletive> <expletive> 5.6.0's harness doesn't even honour
-    # TODO tests.
-    warn "# Test skipped because eq is buggy for certain Unicode cases in 5.6.0";
-    warn "# Please upgrade to 5.6.1\n";
-    ok ("I'd really like to fail this test on 5.6.0 but I'm told that CPAN auto-dependencies mess up, and certain vendors only ship 5.6.0. Get your vendor to ugrade. Else upgrade your vendor.");
-    # One such vendor being the folks who brought you LONG_MIN as a positive
-    # integer.
-  } else {
-    is ($$scalar, $expected, "And it is the data we expected?");
-  }
+  is ($$scalar, $expected, "And it is the data we expected?");
   $scalar;
 }
 
@@ -189,26 +177,11 @@ if (eval "use Hash::Util; 1") {
   thaw_fail ('Locked keys placeholder', $RESTRICTED_CROAK);
 }
 
-if ($] >= 5.006) {
-  print "# We have utf8 scalars, so test that the utf8 scalars in <DATA> are valid\n";
-  thaw_scalar ('Short 8 bit utf8 data', "\xDF", 1);
-  thaw_scalar ('Long 8 bit utf8 data', "\xDF" x 256, 1);
-  thaw_scalar ('Short 24 bit utf8 data', chr 0xC0FFEE);
-  thaw_scalar ('Long 24 bit utf8 data', chr (0xC0FFEE) x 256);
-} else {
-  print "# We don't have utf8 scalars, so test that the utf8 scalars downgrade\n";
-  thaw_fail ('Short 8 bit utf8 data', $UTF8_CROAK);
-  thaw_fail ('Long 8 bit utf8 data', $UTF8_CROAK);
-  thaw_fail ('Short 24 bit utf8 data', $UTF8_CROAK);
-  thaw_fail ('Long 24 bit utf8 data', $UTF8_CROAK);
-  local $Storable::drop_utf8 = 1;
-  my $bytes = thaw $tests{'Short 8 bit utf8 data as bytes'};
-  thaw_scalar ('Short 8 bit utf8 data', $$bytes);
-  thaw_scalar ('Long 8 bit utf8 data', $$bytes x 256);
-  $bytes = thaw $tests{'Short 24 bit utf8 data as bytes'};
-  thaw_scalar ('Short 24 bit utf8 data', $$bytes);
-  thaw_scalar ('Long 24 bit utf8 data', $$bytes x 256);
-}
+print "# We have utf8 scalars, so test that the utf8 scalars in <DATA> are valid\n";
+thaw_scalar ('Short 8 bit utf8 data', "\xDF", 1);
+thaw_scalar ('Long 8 bit utf8 data', "\xDF" x 256, 1);
+thaw_scalar ('Short 24 bit utf8 data', chr 0xC0FFEE);
+thaw_scalar ('Long 24 bit utf8 data', chr (0xC0FFEE) x 256);
 
 if ($] > 5.007002) {
   print "# We have utf8 hashes, so test that the utf8 hashes in <DATA> are valid\n";
@@ -240,8 +213,7 @@ if ($] > 5.007002) {
   thaw_fail ('Hash with utf8 keys', $UTF8_CROAK);
   thaw_fail ('Locked hash with utf8 keys', $UTF8_CROAK);
   local $Storable::drop_utf8 = 1;
-  my $what = $] < 5.006 ? 'pre 5.6' : '5.6';
-  my $expect = thaw $tests{"Hash with utf8 keys for $what"};
+  my $expect = thaw $tests{"Hash with utf8 keys for 5.6"};
   thaw_hash ('Hash with utf8 keys', $expect);
   #foreach (keys %$expect) { print "'$_':\t'$expect->{$_}'\n"; }
   #foreach (keys %$got) { print "'$_':\t'$got->{$_}'\n"; }
@@ -370,12 +342,6 @@ D96%U%P/EGXX%`````^6?CA<'4V-H;&_#GP8````&4V-H;&_?
 
 end
 
-begin 101 Hash with utf8 keys for pre 5.6
-M!049``````0*!F-A<W1L90`````&8V%S=&QE"@=C:.5T96%U``````=C:.5T
-D96%U"@/EGXX``````^6?C@H'4V-H;&_#GP(````&4V-H;&_?
-
-end
-
 begin 101 Hash with utf8 keys for 5.6
 M!049``````0*!F-A<W1L90`````&8V%S=&QE"@=C:.5T96%U``````=C:.5T
 D96%U%P/EGXX``````^6?CA<'4V-H;&_#GP(````&4V-H;&_?
@@ -494,12 +460,6 @@ FHY.%%P3<9')5!0````3<9')5%P?B@XB3EHMS!@````;B@XB3EM\`
 
 end
 
-begin 301 Hash with utf8 keys for pre 5.6
-M!049``````0*!H.!HJ.3A0`````&@X&BHY.%"@B#B(M&HX6!I``````'@XA'
-GHX6!I`H'XH.(DY:+<P(````&XH.(DY;?"@3<9')5``````3<9')5
-
-end
-
 begin 301 Hash with utf8 keys for 5.6
 M!049``````0*!H.!HJ.3A0`````&@X&BHY.%"@>#B$>CA8&D``````>#B$>C
 FA8&D%P?B@XB3EHMS`@````;B@XB3EM\7!-QD<E4`````!-QD<E4`