aboutsummaryrefslogtreecommitdiff
path: root/t/02-empty-source.t
diff options
context:
space:
mode:
Diffstat (limited to 't/02-empty-source.t')
-rw-r--r--t/02-empty-source.t28
1 files changed, 28 insertions, 0 deletions
diff --git a/t/02-empty-source.t b/t/02-empty-source.t
new file mode 100644
index 0000000..684a98b
--- /dev/null
+++ b/t/02-empty-source.t
@@ -0,0 +1,28 @@
+#! /usr/bin/env perl6
+
+use v6.c;
+use lib 'lib';
+use Test;
+
+plan 2;
+
+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;
+
+$nil.merge($hash);
+
+is-deeply $nil, $hash, "Merge into uninitialized hash";