From e78b410859d63915fe92b9b361ca9221ea6a4ff7 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 27 Feb 2025 10:04:13 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Add=20test=20for=20me?= =?UTF-8?q?rging=20into=20an=20empty=20hashtable=20in=20`Merge-Hashtable`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/Hashtable.Tests.ps1 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/Hashtable.Tests.ps1 b/tests/Hashtable.Tests.ps1 index 561cbe8..37ce79f 100644 --- a/tests/Hashtable.Tests.ps1 +++ b/tests/Hashtable.Tests.ps1 @@ -1,5 +1,17 @@ Describe 'Module' { Describe 'Merge-Hashtable' { + It 'Merges into an empty hashtable' { + $Main = @{} + $Override = @{ + Key1 = 'Value1' + Key2 = 'Value2' + } + $Result = Merge-Hashtable -Main $Main -Overrides $Override + + $Result.Key1 | Should -Be 'Value1' + $Result.Key2 | Should -Be 'Value2' + } + It 'Merges two hashtable' { $Main = @{ Action = ''