Skip to content

Commit

Permalink
Updated test files encoding to UTF-8 w/ BOM to support WindowsPowershell
Browse files Browse the repository at this point in the history
This will fix failing tests on Windows 2016 / PS 5.1
  • Loading branch information
RobFaie committed Mar 30, 2020
1 parent 4d727c3 commit 8ceaf79
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 3 deletions.
100 changes: 98 additions & 2 deletions tests/ConvertTo-UnicodeEscape.tests.ps1
Original file line number Diff line number Diff line change
@@ -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: <Char>' -TestCases $cases {
Param ($Char)
Expand Down
2 changes: 1 addition & 1 deletion tests/Invoke-Method.tests.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')]
Param()

Import-Module "$PSScriptRoot/../PwshZendesk.psm1" -Force
Expand Down

0 comments on commit 8ceaf79

Please sign in to comment.