So that these tests pass on 5.12 and below.
use strict;
use warnings;
use strict;
use warnings;
-use Variable::Temp 'temp';
+use Variable::Temp 'set_temp';
use Test::More tests => 7;
my $x = 1;
is $x, 1;
{
use Test::More tests => 7;
my $x = 1;
is $x, 1;
{
is $x, 2;
$x = 3;
is $x, 3;
{
is $x, 2;
$x = 3;
is $x, 3;
{
use strict;
use warnings;
use strict;
use warnings;
-use Variable::Temp 'temp';
+use Variable::Temp 'set_temp';
use Test::More tests => 13;
our $x = 1;
is $x, 1;
{
use Test::More tests => 13;
our $x = 1;
is $x, 1;
{
is $x, 2;
$x = 3;
is $x, 3;
{
is $x, 2;
$x = 3;
is $x, 3;
{
is $x, 3;
{
local $x = 7;
is $x, 3;
{
local $x = 7;
local $x = 10;
is $x, 10;
}
local $x = 10;
is $x, 10;
}
use strict;
use warnings;
use strict;
use warnings;
-use Variable::Temp 'temp';
+use Variable::Temp 'set_temp';
use Test::More tests => 16;
use Test::More tests => 16;
});
is $x_is_destroyed, 0;
});
is $x_is_destroyed, 0;
- temp $x = VPIT::TestHelpers::Guard->new(sub {
+ set_temp $x => VPIT::TestHelpers::Guard->new(sub {
is $x_is_destroyed, 0;
is $x_temp2_is_destroyed, 1;
++$x_temp1_is_destroyed;
is $x_is_destroyed, 0;
is $x_temp2_is_destroyed, 1;
++$x_temp1_is_destroyed;
is $x_temp1_is_destroyed, 0;
is $x_temp2_is_destroyed, 0;
is $x_temp1_is_destroyed, 0;
is $x_temp2_is_destroyed, 0;
- temp $x = VPIT::TestHelpers::Guard->new(sub {
+ set_temp $x => VPIT::TestHelpers::Guard->new(sub {
is $x_is_destroyed, 0;
is $x_temp1_is_destroyed, 0;
++$x_temp2_is_destroyed;
is $x_is_destroyed, 0;
is $x_temp1_is_destroyed, 0;
++$x_temp2_is_destroyed;
use strict;
use warnings;
use strict;
use warnings;
-use Variable::Temp 'temp';
+use Variable::Temp 'set_temp';
use Test::More tests => 14;
use Test::More tests => 14;
is $y, 2;
is $replaced, 1;
is $freed, 0;
is $y, 2;
is $replaced, 1;
is $freed, 0;