X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F22-len.t;h=7025e7bb1ffce743f0d70f5a83aef9a72dec3cac;hb=b9df7824d4619174e28f9b1b5856c4a228d9cc7b;hp=3b8039efc1f926af430c4c5da0eda14235d5aa19;hpb=da422089a9a5dfbf84e72ec3ba867063471ff41c;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/t/22-len.t b/t/22-len.t index 3b8039e..7025e7b 100644 --- a/t/22-len.t +++ b/t/22-len.t @@ -3,9 +3,12 @@ use strict; use warnings; -use Test::More tests => 33; +use Test::More tests => 33 + (2 * 2 + 1); -use Variable::Magic qw/wizard cast VMG_COMPAT_SCALAR_LENGTH_NOLEN/; +use Variable::Magic qw/wizard cast dispell VMG_COMPAT_SCALAR_LENGTH_NOLEN/; + +use lib 't/lib'; +use Variable::Magic::TestValue; my $c = 0; @@ -124,3 +127,14 @@ SKIP: { is $d, 5, 'len: get utf8 scalar length have correct default length'; is $b, $d, 'len: get utf8 scalar length correctly'; } + +{ + my @val = (4 .. 6); + + my $wv = init_value @val, 'len', 'len'; + + value { $val[-1] = 8 } [ 4, 5, 6 ]; + + dispell @val, $wv; + is_deeply \@val, [ 4, 5, 8 ], 'len: after value'; +}