]> git.vpit.fr Git - perl/modules/Variable-Temp.git/blob - t/10-lexical.t
Use set_temp() in tests instead of temp()
[perl/modules/Variable-Temp.git] / t / 10-lexical.t
1 #!perl -T
2
3 use strict;
4 use warnings;
5
6 use Variable::Temp 'set_temp';
7
8 use Test::More tests => 7;
9
10 my $x = 1;
11 is $x, 1;
12 {
13  set_temp $x => 2;
14  is $x, 2;
15  $x = 3;
16  is $x, 3;
17  {
18   set_temp $x => 4;
19   is $x, 4;
20   set_temp $x => 5;
21   is $x, 5;
22  }
23  is $x, 3;
24 }
25 is $x, 1;