Fix up broken Windows test when run with coverage (#65085)

This commit is contained in:
Jordan Borean 2019-11-20 08:53:38 +10:00 committed by GitHub
parent 765b054f15
commit f5133bec22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -219,8 +219,9 @@ $tests = @{
}
"CreateProcess with unicode and us-ascii encoding" = {
$actual = [Ansible.Process.ProcessUtil]::CreateProcess($null, "cmd.exe /c echo 💩 café", $null, $null, '', 'us-ascii')
$actual.StandardOut | Assert-Equals -Expected "???? caf??`r`n"
$poop = [System.Char]::ConvertFromUtf32(0xE05A) # Coverage breaks due to script parsing encoding issues with unicode chars, just use the code point instead
$actual = [Ansible.Process.ProcessUtil]::CreateProcess($null, "cmd.exe /c echo $poop café", $null, $null, '', 'us-ascii')
$actual.StandardOut | Assert-Equals -Expected "??? caf??`r`n"
$actual.StandardError | Assert-Equals -Expected ""
$actual.ExitCode | Assert-Equals -Expected 0
}