aboutsummaryrefslogtreecommitdiff
path: root/t/01-thing.t
diff options
context:
space:
mode:
Diffstat (limited to 't/01-thing.t')
-rw-r--r--t/01-thing.t15
1 files changed, 10 insertions, 5 deletions
diff --git a/t/01-thing.t b/t/01-thing.t
index 9a906a7..402c157 100644
--- a/t/01-thing.t
+++ b/t/01-thing.t
@@ -5,27 +5,32 @@ use mergehash;
use Test;
my %a;
my %b;
-#%a<Z> = "orig";
-#%b<Z> = "new";
%a<b> = 1;
%b<a> = 2;
%a<y><z> = 2;
%b<y><a> = 1;
my %b-orig = %b;
my %a-orig = %a;
+
+
%a.merge(%b);
is-deeply %b, %b-orig;
is-deeply %a, {:a(2), :b(1), :y(${:a(1), :z(2)})};
+
+
%a = %a-orig;
%b = %b-orig;
%a<Z> = "orig";
%b<Z> = "new";
+%a.merge(%b);
is-deeply %a, {Z => 'new', a => 2, b => 1, y => {a => 1, z => 2}};
-say %a;
-my %z;
+
+
+my (%z, %y);
%z<y><p> = (1,2,3,4);
-my %y;
%y<y><p> = (5,4,6,7);
%z.merge(%y);
is %z, {y => {p => [1, 2, 3, 4, 5, 4, 6, 7]}}, "merges arrays";
+
+
done-testing;