# -*- Mode: CPerl -*- use strict; use warnings; use Test::More 'no_plan'; use Hash::MultiKey; tie my (%hmk), 'Hash::MultiKey'; my @mk = (["foo"], ["foo", "bar", "baz"], ["foo", "bar", "baz", "zoo"], ["goo"], ["goo", "car", "caz"], ["goo", "car", "caz", "aoo"], ["branch", "with", "no", "bifur$;ations"],); my @v = (undef, 1, 'string', ['array', 'ref'], {hash => 'ref', with => 'three', keys => undef}, \7, undef,); # initialize %hmk $hmk{$mk[$_]} = $v[$_] foreach 0..$#mk; # clear %hmk = (); is(scalar(keys %hmk), 0, 'clear - keys'); is(scalar(values %hmk), 0, 'clear - values'); ok(!scalar(%hmk), 'clear - hash'); eq_array([%hmk], [], 'clear - flatten');