File: from_mixed.t

package info (click to toggle)
libhash-multivalue-perl 0.16-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 192 kB
  • sloc: perl: 270; makefile: 2
file content (18 lines) | stat: -rw-r--r-- 366 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use strict;
use Test::More;
use Hash::MultiValue;

my $hash = Hash::MultiValue->from_mixed({
    foo => [ 'a', 'b' ],
    bar => 'baz',
    baz => 33,
});

is "$hash->{foo}", 'b';
is ref $hash->{foo}, '';
my @foo = $hash->get_all('foo');
is_deeply \@foo, [ 'a', 'b' ];
is_deeply [ sort keys %$hash ], [ 'bar', 'baz', 'foo' ];
is $hash->{baz} + 2, 35;

done_testing;