From 2bae2a1742fcc7f008b600bfb0f484588be32220 Mon Sep 17 00:00:00 2001 From: Merill Fernando Date: Thu, 23 Jul 2026 00:29:50 +1000 Subject: [PATCH] Fix Windows connection formatting tests --- powershell/tests/functions/Test-MtConnection.Tests.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/powershell/tests/functions/Test-MtConnection.Tests.ps1 b/powershell/tests/functions/Test-MtConnection.Tests.ps1 index 8f7475309..d00133d5e 100644 --- a/powershell/tests/functions/Test-MtConnection.Tests.ps1 +++ b/powershell/tests/functions/Test-MtConnection.Tests.ps1 @@ -512,7 +512,7 @@ Describe 'Test-MtConnection — requested service formatting' { ) $ExpectedServiceOrder | ForEach-Object { - $Rendered | Should -Match "(?m)^$([regex]::Escape($_))\s+: Not connected$" + $Rendered | Should -Match "(?m)^$([regex]::Escape($_))\s+: Not connected\r?$" } for ($i = 1; $i -lt $ExpectedServiceOrder.Count; $i++) { @@ -543,8 +543,8 @@ Describe 'Test-MtConnection — requested service formatting' { $Rendered = $Result | Out-String @($Result.ServicesChecked) | Should -Be @('Graph', 'GitHub') - $Rendered | Should -Match '(?m)^Microsoft Graph\s+: Not connected$' - $Rendered | Should -Match '(?m)^GitHub\s+: Not connected$' + $Rendered | Should -Match '(?m)^Microsoft Graph\s+: Not connected\r?$' + $Rendered | Should -Match '(?m)^GitHub\s+: Not connected\r?$' $Rendered | Should -Not -Match '(?m)^Azure\s+:' } @@ -571,7 +571,7 @@ Describe 'Test-MtConnection — requested service formatting' { ) $ExpectedServiceOrder | ForEach-Object { - $Rendered | Should -Match "(?m)^$([regex]::Escape($_))\s+: Not connected$" + $Rendered | Should -Match "(?m)^$([regex]::Escape($_))\s+: Not connected\r?$" } for ($i = 1; $i -lt $ExpectedServiceOrder.Count; $i++) { @@ -594,7 +594,7 @@ Describe 'Test-MtConnection — requested service formatting' { $Rendered = Test-MtConnection -Service $Service -Details | Out-String $Rendered | - Should -Match '(?m)^Exchange Online Protection\s+: Not connected$' + Should -Match '(?m)^Exchange Online Protection\s+: Not connected\r?$' } }