From: Vincent Pit Date: Thu, 12 Mar 2015 15:09:18 +0000 (-0300) Subject: Use set_temp() in tests instead of temp() X-Git-Tag: v0.02~13 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FVariable-Temp.git;a=commitdiff_plain;h=18eafa9533d73e88dee2e1114b4835fb8a65d844 Use set_temp() in tests instead of temp() So that these tests pass on 5.12 and below. --- diff --git a/t/10-lexical.t b/t/10-lexical.t index 41bbf45..8fc07fa 100644 --- a/t/10-lexical.t +++ b/t/10-lexical.t @@ -3,21 +3,21 @@ use strict; use warnings; -use Variable::Temp 'temp'; +use Variable::Temp 'set_temp'; use Test::More tests => 7; my $x = 1; is $x, 1; { - temp $x = 2; + set_temp $x => 2; is $x, 2; $x = 3; is $x, 3; { - temp $x = 4; + set_temp $x => 4; is $x, 4; - temp $x = 5; + set_temp $x => 5; is $x, 5; } is $x, 3; diff --git a/t/11-global.t b/t/11-global.t index 047529c..99a40f5 100644 --- a/t/11-global.t +++ b/t/11-global.t @@ -3,21 +3,21 @@ use strict; use warnings; -use Variable::Temp 'temp'; +use Variable::Temp 'set_temp'; use Test::More tests => 13; our $x = 1; is $x, 1; { - temp $x = 2; + set_temp $x => 2; is $x, 2; $x = 3; is $x, 3; { - temp $x = 4; + set_temp $x => 4; is $x, 4; - temp $x = 5; + set_temp $x => 5; is $x, 5; } is $x, 3; @@ -28,12 +28,12 @@ is $x, 1; is $x, 3; { local $x = 7; - temp $x = 8; + set_temp $x => 8; is $x, 8; } is $x, 3; { - temp $x = 9; + set_temp $x => 9; local $x = 10; is $x, 10; } diff --git a/t/12-destroy.t b/t/12-destroy.t index 4821741..5fdc853 100644 --- a/t/12-destroy.t +++ b/t/12-destroy.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Variable::Temp 'temp'; +use Variable::Temp 'set_temp'; use Test::More tests => 16; @@ -22,7 +22,7 @@ my $x_temp2_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; @@ -31,7 +31,7 @@ my $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; diff --git a/t/13-magic.t b/t/13-magic.t index 883088b..69d049e 100644 --- a/t/13-magic.t +++ b/t/13-magic.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Variable::Temp 'temp'; +use Variable::Temp 'set_temp'; use Test::More tests => 14; @@ -28,7 +28,7 @@ my $wiz = Variable::Magic::wizard( is $freed, 0; { - temp $y = 2; + set_temp $y => 2; is $y, 2; is $replaced, 1; is $freed, 0;