blob: b404a63636657d212af03e58c79ae6bb4ec4d8b6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#! /usr/bin/env perl6
use v6.c;
use lib 'lib';
use Test;
plan 3;
use Hash::Merge;
my Hash $hash = {
a => "a",
b => {
c => "c"
}
};
my Hash $empty = {};
$empty.merge($hash);
is-deeply $empty, $hash, "Merge into empty hash";
my Hash $nil;
throws-like $nil.merge($hash), Exception, "Merge into uninitialized hash";
is-deeply $nil.merge($hash), $hash, "Returns supplied hash if it throws";
|