Correct case of $OFS special variable

This commit is contained in:
xtqqczze 2020-01-13 19:05:05 +00:00
parent d58e1ff13b
commit fbe459d480

View file

@ -25,13 +25,13 @@ Describe "Join-String" -Tags "CI" {
}
It "Should join property values with default separator" {
$expected = $testObject.Name -join $ofs
$expected = $testObject.Name -join $OFS
$actual = $testObject | Join-String -Property Name
$actual | Should -BeExactly $expected
}
It "Should join property values positionally with default separator" {
$expected = $testObject.Name -join $ofs
$expected = $testObject.Name -join $OFS
$actual = $testObject | Join-String Name
$actual | Should -BeExactly $expected
}
@ -69,7 +69,7 @@ Describe "Join-String" -Tags "CI" {
It "Should join script block results with default separator" {
$sb = {$_.Name + $_.Length}
$expected = ($testObject | ForEach-Object $sb) -join $ofs
$expected = ($testObject | ForEach-Object $sb) -join $OFS
$actual = $testObject | Join-String -Property $sb
$actual | Should -BeExactly $expected
}
@ -83,13 +83,13 @@ Describe "Join-String" -Tags "CI" {
It "Should join script block results SingleQuoted" {
$sb = {$_.Name + $_.Length}
$expected = ($testObject | ForEach-Object $sb).ForEach{"'$_'"} -join $ofs
$expected = ($testObject | ForEach-Object $sb).ForEach{"'$_'"} -join $OFS
$actual = $testObject | Join-String -Property $sb -SingleQuote
$actual | Should -BeExactly $expected
}
It "Should join script block results DoubleQuoted" {
$sb = {$_.Name + $_.Length}
$expected = ($testObject | ForEach-Object $sb).ForEach{"""$_"""} -join $ofs
$expected = ($testObject | ForEach-Object $sb).ForEach{"""$_"""} -join $OFS
$actual = $testObject | Join-String -Property $sb -DoubleQuote
$actual | Should -BeExactly $expected
}
@ -102,7 +102,7 @@ Describe "Join-String" -Tags "CI" {
}
It "Should Handle OutputPrefix and OutputSuffix" {
$ofs = ','
$OFS = ','
$expected = "A 1,2,3 B"
$actual = 1..3 | Join-String -OutputPrefix "A " -OutputSuffix " B"
$actual | Should -BeExactly $expected