From 7c12bca644bcbdc39c920290f7819f64d1a45ab4 Mon Sep 17 00:00:00 2001 From: Samantha McVey Date: Mon, 24 Apr 2017 23:26:41 -0700 Subject: Add support for replacing and not appending the array. Add POD6 --- t/01-thing.t | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 't') diff --git a/t/01-thing.t b/t/01-thing.t index 402c157..68b092e 100644 --- a/t/01-thing.t +++ b/t/01-thing.t @@ -25,12 +25,19 @@ is-deeply %a, {:a(2), :b(1), :y(${:a(1), :z(2)})}; %a.merge(%b); is-deeply %a, {Z => 'new', a => 2, b => 1, y => {a => 1, z => 2}}; - -my (%z, %y); -%z

= (1,2,3,4); -%y

= (5,4,6,7); -%z.merge(%y); -is %z, {y => {p => [1, 2, 3, 4, 5, 4, 6, 7]}}, "merges arrays"; - +{ + my (%z, %y); + %z

= (1,2,3,4); + %y

= (5,4,6,7); + %z.merge(%y); + is %z, {y => {p => [1, 2, 3, 4, 5, 4, 6, 7]}}, "appends arrays"; +} +{ + my (%z, %y); + %z

= (1,2,3,4); + %y

= (5,4,6,7); + %z.merge(%y, :no-append-array); + is-deeply %z, ${:y(${:p($(5, 4, 6, 7))})}, "no-append-array (replaces the instead)"; +} done-testing; -- cgit v1.1