From: Vincent Pit Date: Mon, 6 Apr 2015 12:27:53 +0000 (-0300) Subject: Skip localized extraneous array elements tests X-Git-Tag: v0.03~1 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FVariable-Temp.git;a=commitdiff_plain;h=bfae3c21b735c4d2843e7fb4003d0a9930e10589 Skip localized extraneous array elements tests my @a = ...; { local [$#a+1] = 'x'; ... } does not reset the array length at scope end before perl 5.12 (actually 5.11). --- diff --git a/t/10-base.t b/t/10-base.t index 701cead..dc1081c 100644 --- a/t/10-base.t +++ b/t/10-base.t @@ -12,6 +12,9 @@ sub describe { return join ', ', map "$_:$h->{$_}", sort keys %$h; } +my $aelem_delete_msg = 'Localized extraneous array elements do not reset array length at scope end before perl 5.12'; +my $aelem_delete_ok = ("$]" >= 5.012); + # Lexicals { @@ -72,7 +75,8 @@ sub describe { { set_temp @y => [ qw ]; is "@y", 'a b c'; - { + SKIP: { + skip $aelem_delete_msg => 3 unless $aelem_delete_ok; local $y[1] = 'd'; is "@y", 'a d c'; { @@ -211,7 +215,8 @@ sub describe { { set_temp @Y => [ qw ]; is "@Y", 'a b c'; - { + SKIP: { + skip $aelem_delete_msg => 3 unless $aelem_delete_ok; local $Y[1] = 'd'; is "@Y", 'a d c'; { diff --git a/t/20-lvalue.t b/t/20-lvalue.t index 226eccc..f46032e 100644 --- a/t/20-lvalue.t +++ b/t/20-lvalue.t @@ -20,6 +20,9 @@ sub describe { return join ', ', map "$_:$h->{$_}", sort keys %$h; } +my $aelem_delete_msg = 'Localized extraneous array elements do not reset array length at scope end before perl 5.12'; +my $aelem_delete_ok = ("$]" >= 5.012); + # Lexicals { @@ -80,7 +83,8 @@ sub describe { { temp @y = [ qw ]; is "@y", 'a b c'; - { + SKIP: { + skip $aelem_delete_msg => 3 unless $aelem_delete_ok; local $y[1] = 'd'; is "@y", 'a d c'; { @@ -219,7 +223,8 @@ sub describe { { temp @Y = [ qw ]; is "@Y", 'a b c'; - { + SKIP: { + skip $aelem_delete_msg => 3 unless $aelem_delete_ok; local $Y[1] = 'd'; is "@Y", 'a d c'; {