From 5849c96fa6a058a8e3d79a17e0de845ab4d03fc8 Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Thu, 12 Nov 2020 20:36:08 +0100 Subject: Rewrite module --- t/02-empty-source.t | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 't/02-empty-source.t') 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"; -- cgit v1.1