X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F31-array.t;h=20ab356034198e2baadf081b6832fb5ed9c71faa;hb=3bc98bdbdb230943e7fb3135e325f10013acac2d;hp=b5ff1ede5d542aca4a3071cb965dc1a9ac81299e;hpb=159e8ad7c747edb4a25db2f2673bbe143531f347;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/t/31-array.t b/t/31-array.t index b5ff1ed..20ab356 100644 --- a/t/31-array.t +++ b/t/31-array.t @@ -5,13 +5,18 @@ use warnings; use Test::More tests => 2 * 27 + 13 + 1; -use Variable::Magic qw/cast dispell VMG_COMPAT_ARRAY_PUSH_NOLEN VMG_COMPAT_ARRAY_PUSH_NOLEN_VOID VMG_COMPAT_ARRAY_UNSHIFT_NOLEN_VOID VMG_COMPAT_ARRAY_UNDEF_CLEAR/; +use Variable::Magic qw< + cast dispell + VMG_COMPAT_ARRAY_PUSH_NOLEN VMG_COMPAT_ARRAY_PUSH_NOLEN_VOID + VMG_COMPAT_ARRAY_UNSHIFT_NOLEN_VOID + VMG_COMPAT_ARRAY_UNDEF_CLEAR +>; use lib 't/lib'; use Variable::Magic::TestWatcher; my $wiz = init_watcher - [ qw/get set len clear free copy dup local fetch store exists delete/ ], + [ qw ], 'array'; my @n = map { int rand 1000 } 1 .. 5; @@ -33,7 +38,7 @@ $b = watch { \@a } { }, 'reference'; @b = watch { @a[2 .. 4] } { }, 'slice'; is_deeply \@b, [ @n[2 .. 4] ], 'array: slice correctly'; -watch { @a = qw/a b d/ } { set => 3, clear => 1 }, 'assign'; +watch { @a = qw } { set => 3, clear => 1 }, 'assign'; watch { $a[2] = 'c' } { }, 'assign old element';