]> git.vpit.fr Git - perl/modules/Variable-Magic.git/blob - t/27-local.t
086d619d9a081d7cf8ac79403e26ef83851204de
[perl/modules/Variable-Magic.git] / t / 27-local.t
1 #!perl -T
2
3 use strict;
4 use warnings;
5
6 use Test::More;
7
8 use Variable::Magic qw<cast MGf_LOCAL>;
9
10 if (MGf_LOCAL) {
11  plan tests => 2 * 3 + 1 + 1;
12 } else {
13  plan skip_all => 'No local magic for this perl';
14 }
15
16 use lib 't/lib';
17 use Variable::Magic::TestWatcher;
18
19 my $wiz = init_watcher 'local', 'local';
20
21 our $a = int rand 1000;
22
23 my $res = watch { cast $a, $wiz } { }, 'cast';
24 ok $res, 'local: cast succeeded';
25
26 watch { local $a } { local => 1 }, 'localized';