diff options
author | Patrick Spek <p.spek@tyil.nl> | 2020-11-12 20:36:08 +0100 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2020-11-12 20:36:08 +0100 |
commit | 5849c96fa6a058a8e3d79a17e0de845ab4d03fc8 (patch) | |
tree | 0538fa597f84e28335f6d7ddf2ba03f9edf0a7c9 /t | |
parent | 95e89dee79200e1ea75b1ef976a30bf6b61e23a7 (diff) |
Rewrite module
Diffstat (limited to 't')
-rw-r--r-- | t/01-thing.t | 4 | ||||
-rw-r--r-- | t/02-empty-source.t | 26 |
2 files changed, 12 insertions, 18 deletions
diff --git a/t/01-thing.t b/t/01-thing.t index ef674ec..44d7495 100644 --- a/t/01-thing.t +++ b/t/01-thing.t @@ -46,9 +46,9 @@ is-deeply %a, {Z => 'new', a => 2, b => 1, y => {a => 1, z => 2}}; %z<y><p> = (1,2,3,4); %y<y><p> = (5,4,6,7); - %z.merge(%y, :no-append-array); + %z.merge(%y, :!positional-append); - is-deeply %z, ${:y(${:p($(5, 4, 6, 7))})}, "no-append-array (replaces the instead)"; + is-deeply %z, ${:y(${:p($(5, 4, 6, 7))})}, ":!positional-append makes lists overwrite"; } done-testing; diff --git a/t/02-empty-source.t b/t/02-empty-source.t index 2737d2d..55403e1 100644 --- a/t/02-empty-source.t +++ b/t/02-empty-source.t @@ -1,28 +1,22 @@ #! /usr/bin/env perl6 -use v6.c; -use lib 'lib'; -use Test; +use v6.d; -plan 3; +use Test; use Hash::Merge::Augment; -my Hash $hash = { +plan 1; + +my %hash = a => "a", b => { c => "c" - } -}; - -my Hash $empty = {}; - -$empty.merge($hash); - -is-deeply $empty, $hash, "Merge into empty hash"; + }, +; -my Hash $nil; +my %empty; +%empty.merge(%hash); -throws-like $nil.merge($hash), Exception, "Merge into uninitialized hash"; -is-deeply $nil.merge($hash), $hash, "Returns supplied hash if it throws"; +is-deeply %empty, %hash, "Merge into empty hash"; |