-my $wiz = wizard get => sub { ++$c[0] },
- set => sub { ++$c[1] },
- len => sub { ++$c[2]; $_[2] },
- clear => sub { ++$c[3] },
- free => sub { ++$c[4] },
- copy => sub { ++$c[5] },
- dup => sub { ++$c[6] },
- local => sub { ++$c[7] },
- fetch => sub { ++$c[8] },
- store => sub { ++$c[9] },
- 'exists' => sub { ++$c[10] },
- 'delete' => sub { ++$c[11] };
-ok(check(), 'hash : create wizard');
-
-my %n = map { $_ => int rand 1000 } qw/foo bar baz qux/;
-my %a = %n;
-
-cast %a, $wiz;
-ok(check(), 'hash : cast');
-
-my $b = $a{foo};
-++$x[5] if MGf_COPY;
-++$x[8] if VMG_UVAR;
-ok(check(), 'hash : assign element to');
-
-my %b = %a;
-ok(check(), 'hash : assign to');
-
-$b = "X%{a}Y";
-ok(check(), 'hash : interpolate');
-
-$b = \%a;
-ok(check(), 'hash : reference');
-
-my @b = @a{qw/bar qux/};
-$x[5] += 2 if MGf_COPY;
-$x[8] += 2 if VMG_UVAR;
-ok(check(), 'hash : slice');
-
-%a = (a => 1, d => 3);
-++$x[3];
-$x[5] += 2 if VMG_UVAR;
-$x[9] += 2 if VMG_UVAR;
-ok(check(), 'hash : assign from list');
-
-%a = map { $_ => 1 } qw/a b d/;
-++$x[3];
-$x[5] += 3 if VMG_UVAR;
-$x[9] += 3 if VMG_UVAR;
-ok(check(), 'hash : assign from map');
-
-$a{d} = 2;
-++$x[5] if MGf_COPY;
-++$x[9] if VMG_UVAR;
-ok(check(), 'hash : assign old element');
-
-$a{c} = 3;
-++$x[5] if MGf_COPY;
-++$x[9] if VMG_UVAR;
-ok(check(), 'hash : assign new element');
-
-$b = %a;
-ok(check(), 'hash : buckets');
-
-@b = keys %a;
-ok(check(), 'hash : keys');
-
-@b = values %a;
-ok(check(), 'hash : values');
-
-while (my ($k, $v) = each %a) { }
-ok(check(), 'hash : each');
-
-{
+watch { %h = () } { clear => 1 }, 'empty in list context';
+
+watch { $h{a} = -1; %h = (b => $h{a}) }
+ +{ (fetch => 1, store => 2, copy => 2) x VMG_UVAR, clear => 1 },
+ 'empty and set in void context';
+
+watch { %h = (a => 1, d => 3) }
+ +{ (store => 2, copy => 2) x VMG_UVAR, clear => 1 },
+ 'assign from list in void context';
+
+@b = watch { %h = (a => 1, d => 3) }
+ +{ (exists => 2, store => 2, copy => 2) x VMG_UVAR, clear => 1 },
+ 'assign from list in void context';
+
+watch { %h = map { $_ => 1 } qw<a b d>; }
+ +{ (store => 3, copy => 3) x VMG_UVAR, clear => 1 },
+ 'assign from map in void context';
+
+watch { $h{d} = 2 } +{ (store => 1) x VMG_UVAR },
+ 'assign old element';
+
+watch { $h{c} = 3 } +{ (store => 1, copy => 1) x VMG_UVAR },
+ 'assign new element';
+
+$s = watch { %h } { }, 'buckets';
+
+@b = watch { keys %h } { }, 'keys';
+is_deeply [ sort @b ], [ qw<a b c d> ], 'hash: keys correctly';
+
+@b = watch { values %h } { }, 'values';
+is_deeply [ sort { $a <=> $b } @b ], [ 1, 1, 2, 3 ], 'hash: values correctly';
+
+watch { while (my ($k, $v) = each %h) { } } { }, 'each';
+
+watch {