diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertFrom-Csv.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertFrom-Csv.Tests.ps1 index 06ba015262..a3050ead5d 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertFrom-Csv.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertFrom-Csv.Tests.ps1 @@ -316,11 +316,12 @@ Line2","Value2" Line2" '@ | ConvertFrom-Csv + $expectedValue = "Line1$([Environment]::NewLine)Line2" $result.Count | Should -Be 2 - $result[0].P1 | Should -Be "Line1`r`nLine2" + $result[0].P1 | Should -Be $expectedValue $result[0].P2 | Should -Be 'Value2' $result[1].P1 | Should -Be 'Value3' - $result[1].P2 | Should -Be "Line1`r`nLine2" + $result[1].P2 | Should -Be $expectedValue } It 'Should handle escaped quotes within fields' { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Csv.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Csv.Tests.ps1 index 0dfe78e811..27842bb7b1 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Csv.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Csv.Tests.ps1 @@ -423,11 +423,12 @@ Line2" '@ | Set-Content -Path $csvFile -NoNewline $result = Import-Csv -Path $csvFile + $expectedValue = "Line1$([Environment]::NewLine)Line2" $result.Count | Should -Be 2 - $result[0].P1 | Should -Be "Line1`r`nLine2" + $result[0].P1 | Should -Be $expectedValue $result[0].P2 | Should -Be 'Value2' $result[1].P1 | Should -Be 'Value3' - $result[1].P2 | Should -Be "Line1`r`nLine2" + $result[1].P2 | Should -Be $expectedValue } It 'Should handle escaped quotes within fields' {