1# -*- Mode: CPerl -*-
2
3use strict;
4use warnings;
5
6use Test::More 'no_plan';
7
8use Hash::MultiKey;
9
10tie my (%hmk), 'Hash::MultiKey';
11
12my @mk = (["foo"],
13          ["foo", "bar", "baz"],
14          ["foo", "bar", "baz", "zoo"],
15          ["goo"],
16          ["goo", "car", "caz"],
17          ["goo", "car", "caz", "aoo"],
18          ["branch", "with", "no", "bifur$;ations"],);
19
20my @v = (undef,
21         1,
22         'string',
23         ['array', 'ref'],
24         {hash => 'ref', with => 'three', keys => undef},
25         \7,
26         undef,);
27
28# initialize %hmk
29$hmk{$mk[$_]} = $v[$_] foreach 0..$#mk;
30
31# fetch
32eval { my $dummy = $hmk{[]} };
33ok($@, 'fetch');
34
35# store
36eval { $hmk{[]} = 0 };
37ok($@, 'store');
38
39# delete
40eval { delete $hmk{[]} };
41ok($@, 'delete');
42
43# exists
44eval { exists $hmk{[]} };
45ok($@, 'exists');
46
47
48