From e3b3965bc25ec3651e881c8062781a9046d296e2 Mon Sep 17 00:00:00 2001 From: Robert McLeod Date: Sun, 29 Mar 2020 22:19:04 +1100 Subject: [PATCH] Updated `ConvertTo-UnicodeEscape.tests.ps1` encoding to UTF-8 w/ BOM Hoping this will fix failing tests on Windows 2016 / PS 5.1 --- azure-pipelines.yml | 2 +- tests/ConvertTo-UnicodeEscape.tests.ps1 | 100 +++++++++++++++++++++++- 2 files changed, 99 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 734bcef..9c7d4c4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -164,8 +164,8 @@ stages: Set-Location -Path '$(Pipeline.Workspace)' Invoke-Pester -EnableExit -OutputFile "$(System.DefaultWorkingDirectory)/Test-Pester-Win2016.xml" -OutputFormat NUnitXML displayName: Pester - continueOnError: true - task: PublishTestResults@2 + condition: always() inputs: testResultsFormat: 'NUnit' testResultsFiles: 'Test-Pester-Win2016.xml' diff --git a/tests/ConvertTo-UnicodeEscape.tests.ps1 b/tests/ConvertTo-UnicodeEscape.tests.ps1 index 1040534..a5e2149 100644 --- a/tests/ConvertTo-UnicodeEscape.tests.ps1 +++ b/tests/ConvertTo-UnicodeEscape.tests.ps1 @@ -1,11 +1,107 @@ -Import-Module "$PSScriptRoot/../PwshZendesk.psm1" -Force +Import-Module "$PSScriptRoot/../PwshZendesk.psm1" -Force Describe 'ConvertTo-UnicodeEscape' { InModuleScope PwshZendesk { # Space to tilde includes most of ascii - $cases = ' '..'~' | ForEach-Object { @{ Char = $_ } } + $cases = @( + @{ Char = ' ' } + @{ Char = '!' } + @{ Char = '"' } + @{ Char = '#' } + @{ Char = '$' } + @{ Char = '%' } + @{ Char = '&' } + @{ Char = "'" } + @{ Char = '(' } + @{ Char = ')' } + @{ Char = '*' } + @{ Char = '+' } + @{ Char = ',' } + @{ Char = '-' } + @{ Char = '.' } + @{ Char = '/' } + @{ Char = '0' } + @{ Char = '1' } + @{ Char = '2' } + @{ Char = '3' } + @{ Char = '4' } + @{ Char = '5' } + @{ Char = '6' } + @{ Char = '7' } + @{ Char = '8' } + @{ Char = '9' } + @{ Char = ':' } + @{ Char = ';' } + @{ Char = '<' } + @{ Char = '=' } + @{ Char = '>' } + @{ Char = '?' } + @{ Char = '@' } + @{ Char = 'A' } + @{ Char = 'B' } + @{ Char = 'C' } + @{ Char = 'D' } + @{ Char = 'E' } + @{ Char = 'F' } + @{ Char = 'G' } + @{ Char = 'H' } + @{ Char = 'I' } + @{ Char = 'J' } + @{ Char = 'K' } + @{ Char = 'L' } + @{ Char = 'M' } + @{ Char = 'N' } + @{ Char = 'O' } + @{ Char = 'P' } + @{ Char = 'Q' } + @{ Char = 'R' } + @{ Char = 'S' } + @{ Char = 'T' } + @{ Char = 'U' } + @{ Char = 'V' } + @{ Char = 'W' } + @{ Char = 'X' } + @{ Char = 'Y' } + @{ Char = 'Z' } + @{ Char = '[' } + @{ Char = '\' } + @{ Char = ']' } + @{ Char = '^' } + @{ Char = '_' } + @{ Char = '`' } + @{ Char = 'a' } + @{ Char = 'b' } + @{ Char = 'c' } + @{ Char = 'd' } + @{ Char = 'e' } + @{ Char = 'f' } + @{ Char = 'g' } + @{ Char = 'h' } + @{ Char = 'i' } + @{ Char = 'j' } + @{ Char = 'k' } + @{ Char = 'l' } + @{ Char = 'm' } + @{ Char = 'n' } + @{ Char = 'o' } + @{ Char = 'p' } + @{ Char = 'q' } + @{ Char = 'r' } + @{ Char = 's' } + @{ Char = 't' } + @{ Char = 'u' } + @{ Char = 'v' } + @{ Char = 'w' } + @{ Char = 'x' } + @{ Char = 'y' } + @{ Char = 'z' } + @{ Char = '{' } + @{ Char = '|' } + @{ Char = '}' } + @{ Char = '~' } + ) It 'Does not escape: ' -TestCases $cases { Param ($Char)