From 7270ba5fe15aa830b32831d7b66045fac6855adc Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Tue, 25 Apr 2017 22:15:52 +0200 Subject: Add tests for merging into empty hash --- t/02-empty-source.t | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 t/02-empty-source.t 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"; -- cgit v1.1