mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
Convert Pester tests to ASCII
Instead of UTF-8 with BOM. Resolves #417.
This commit is contained in:
1 parent
901160cb78
commit
0aaf74bdcc
52 files changed
+648
-517
No files matched your search
@@ -1,37 +1,37 @@
|
||||
Describe "Out-String" {
|
||||
$nl = [Environment]::NewLine
|
||||
|
||||
It "Should accumulate the strings and returns them as a single string" {
|
||||
$testArray = "a", " b"
|
||||
|
||||
$testArray.GetType().BaseType | Should Be array
|
||||
|
||||
$testArray | Out-String | Should Be "a$nl b$nl"
|
||||
|
||||
$($testArray | Out-String).GetType() | Should Be string
|
||||
}
|
||||
|
||||
It "Should be able to return an array of strings using the stream switch" {
|
||||
$testInput = "a", "b"
|
||||
|
||||
$($testInput | Out-String).GetType() | Should Be string
|
||||
|
||||
$($testInput | Out-String -Stream).GetType().BaseType.Name | Should Be array
|
||||
}
|
||||
|
||||
It "Should send all objects through a pipeline when not using the stream switch" {
|
||||
$testInput = "a", "b"
|
||||
$streamoutputlength = $($testInput | Out-String -Stream).Length
|
||||
$nonstreamoutputlength = $($testInput | Out-String).Length
|
||||
|
||||
$nonstreamoutputlength| Should BeGreaterThan $streamoutputlength
|
||||
}
|
||||
|
||||
It "Should send a single object through a pipeline when the stream switch is used" {
|
||||
$testInput = "a", "b"
|
||||
$streamoutputlength = $($testInput | Out-String -Stream).Length
|
||||
$nonstreamoutputlength = $($testInput | Out-String).Length
|
||||
|
||||
$streamoutputlength | Should BeLessThan $nonstreamoutputlength
|
||||
}
|
||||
}
|
||||
Describe "Out-String" {
|
||||
$nl = [Environment]::NewLine
|
||||
|
||||
It "Should accumulate the strings and returns them as a single string" {
|
||||
$testArray = "a", " b"
|
||||
|
||||
$testArray.GetType().BaseType | Should Be array
|
||||
|
||||
$testArray | Out-String | Should Be "a$nl b$nl"
|
||||
|
||||
$($testArray | Out-String).GetType() | Should Be string
|
||||
}
|
||||
|
||||
It "Should be able to return an array of strings using the stream switch" {
|
||||
$testInput = "a", "b"
|
||||
|
||||
$($testInput | Out-String).GetType() | Should Be string
|
||||
|
||||
$($testInput | Out-String -Stream).GetType().BaseType.Name | Should Be array
|
||||
}
|
||||
|
||||
It "Should send all objects through a pipeline when not using the stream switch" {
|
||||
$testInput = "a", "b"
|
||||
$streamoutputlength = $($testInput | Out-String -Stream).Length
|
||||
$nonstreamoutputlength = $($testInput | Out-String).Length
|
||||
|
||||
$nonstreamoutputlength| Should BeGreaterThan $streamoutputlength
|
||||
}
|
||||
|
||||
It "Should send a single object through a pipeline when the stream switch is used" {
|
||||
$testInput = "a", "b"
|
||||
$streamoutputlength = $($testInput | Out-String -Stream).Length
|
||||
$nonstreamoutputlength = $($testInput | Out-String).Length
|
||||
|
||||
$streamoutputlength | Should BeLessThan $nonstreamoutputlength
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user