use Variable::Magic::TestWatcher;
my $wiz = init
- [ qw/get set len free dup local fetch store exists delete/ ], # clear copy
+ [ qw/get set len free copy dup local fetch store exists delete/ ], # clear
'hash';
my %n = map { $_ => int rand 1000 } qw/foo bar baz qux/;
check { %h = () } { }, 'empty in list context'; # clear => 1
check { %h = (a => 1, d => 3); () }
- +{ (store => 2) x VMG_UVAR },
- # clear => 1, (copy => 2) x VMG_UVAR
+ +{ (store => 2, copy => 2) x VMG_UVAR }, # clear => 1
'assign from list in void context';
check { %h = map { $_ => 1 } qw/a b d/; }
- +{ (exists => 3, store => 3) x VMG_UVAR },
- # clear => 1, (copy => 3) x VMG_UVAR
+ +{ (exists => 3, store => 3, copy => 3) x VMG_UVAR }, # clear =>1
'assign from map in list context';
check { $h{d} = 2; () } +{ (store => 1) x VMG_UVAR },
'assign old element';
-check { $h{c} = 3; () } +{ (store => 1) x VMG_UVAR },
- # (copy => 1) x VMG_UVAR # maybe also if clear magic
+check { $h{c} = 3; () } +{ (store => 1, copy => 1) x VMG_UVAR },
'assign new element';
check { $s = %h } { }, 'buckets';