diff --git a/test/powershell/Add-Content.Tests.ps1 b/test/powershell/Add-Content.Tests.ps1 index 326cb1bc0..8f0312351 100644 --- a/test/powershell/Add-Content.Tests.ps1 +++ b/test/powershell/Add-Content.Tests.ps1 @@ -11,11 +11,11 @@ Describe "Add-Content cmdlet tests" { $result = get-content -path testdrive:\$file1 $result | Should BeExactly "ExpectedContent" } - It "should Add-Content to testdrive:\dynamicfile.txt with dynamic parameters" { + It "should Add-Content to testdrive:\dynamicfile.txt with dynamic parameters" -Pending:($IsLinux -Or $IsOSX) {#https://github.com/PowerShell/PowerShell/issues/891 $result=add-content -path testdrive:\dynamicfile.txt -value "ExpectedContent" -passthru $result| Should BeExactly "ExpectedContent" } - It "should return expected string from testdrive:\dynamicfile.txt" { + It "should return expected string from testdrive:\dynamicfile.txt" -Pending:($IsLinux -Or $IsOSX) {#https://github.com/PowerShell/PowerShell/issues/891 $result = get-content -path testdrive:\dynamicfile.txt $result | Should BeExactly "ExpectedContent" } @@ -35,7 +35,7 @@ Describe "Add-Content cmdlet tests" { #[DRT][BugId(BugDatabase.WindowsOutOfBandReleases, 906022)] {add-content -path HKLM:\\software\\microsoft -value "ShouldNotWorkBecausePathIsUnsupported" -ea stop} | Should Throw "IContentCmdletProvider interface is not implemented" } - It "should be able to pass multiple [string]`$objects to Add-Content through the pipeline to output a dynamic Path file" { + It "should be able to pass multiple [string]`$objects to Add-Content through the pipeline to output a dynamic Path file" -Pending:($IsLinux -Or $IsOSX) {#https://github.com/PowerShell/PowerShell/issues/891 #[DRT][BugId(BugDatabase.WindowsOutOfBandReleases, 9058182)] "hello","world"|add-content testdrive:\dynamicfile2.txt $result=get-content testdrive:\dynamicfile2.txt diff --git a/test/powershell/Get-Content.Tests.ps1 b/test/powershell/Get-Content.Tests.ps1 index e843ceb22..985b505d0 100644 --- a/test/powershell/Get-Content.Tests.ps1 +++ b/test/powershell/Get-Content.Tests.ps1 @@ -120,12 +120,14 @@ Describe "Get-Content" { $result=get-content -path $testPath -delimiter "," -tail 2 $result.Length | Should Be 2 - $expected = "World3`r`nHello4,","World4`r`n" + if ($IsWindows) {$expected = "World3`r`nHello4,","World4`r`n" + } else {$expected = "World3`nHello4,","World4`n"} for ($i = 0; $i -lt $result.Length ; $i++) { $result[$i] | Should BeExactly $expected[$i]} $result=get-content -path $testPath -delimiter "o" -tail 3 $result.Length | Should Be 3 - $expected = "rld3`r`nHello","4,Wo","rld4" + if ($IsWindows) {$expected = "rld3`r`nHello","4,Wo","rld4" + } else {$expected = "rld3`nHello","4,Wo","rld4"} for ($i = 0; $i -lt $result.Length ; $i++) { $result[$i].Trim() | Should BeExactly $expected[$i]} $result=get-content -path $testPath -encoding:Byte -tail 10 @@ -138,7 +140,8 @@ Describe "Get-Content" { set-content $testPath "Hello,llllWorlld","Hello2,llllWorlld2" $result=get-content $testPath -delimiter "ll" $result.Length | Should Be 9 - $expected = "Hell","o,ll","ll","Worll","d`r`nHell","o2,ll","ll","Worll","d2`r`n" + if ($IsWindows) {$expected = "Hell","o,ll","ll","Worll","d`r`nHell","o2,ll","ll","Worll","d2`r`n" + } else {$expected = "Hell","o,ll","ll","Worll","d`nHell","o2,ll","ll","Worll","d2`n"} for ($i = 0; $i -lt $result.Length ; $i++) { $result[$i] | Should BeExactly $expected[$i]} } } diff --git a/test/powershell/Set-Content.Tests.ps1 b/test/powershell/Set-Content.Tests.ps1 index 761de9cee..5a0feebbc 100644 --- a/test/powershell/Set-Content.Tests.ps1 +++ b/test/powershell/Set-Content.Tests.ps1 @@ -11,11 +11,11 @@ Describe "Set-Content cmdlet tests" { $result = get-content -path testdrive:\$file1 $result | Should BeExactly "ExpectedContent" } - It "should Set-Content to testdrive:\dynamicfile.txt with dynamic parameters" { + It "should Set-Content to testdrive:\dynamicfile.txt with dynamic parameters" -Pending:($IsLinux -Or $IsOSX) {#https://github.com/PowerShell/PowerShell/issues/891 $result=set-content -path testdrive:\dynamicfile.txt -value "ExpectedContent" -passthru $result| Should BeExactly "ExpectedContent" } - It "should return expected string from testdrive:\dynamicfile.txt" { + It "should return expected string from testdrive:\dynamicfile.txt" -Pending:($IsLinux -Or $IsOSX) {#https://github.com/PowerShell/PowerShell/issues/891 $result = get-content -path testdrive:\dynamicfile.txt $result | Should BeExactly "ExpectedContent" } @@ -38,7 +38,7 @@ Describe "Set-Content cmdlet tests" { #[DRT][BugId(BugDatabase.WindowsOutOfBandReleases, 906022)] {set-content -path HKLM:\\software\\microsoft -value "ShouldNotWorkBecausePathIsUnsupported" -ea stop} | Should Throw "IContentCmdletProvider interface is not implemented" } - It "should be able to pass multiple [string]`$objects to Set-Content through the pipeline to output a dynamic Path file" { + It "should be able to pass multiple [string]`$objects to Set-Content through the pipeline to output a dynamic Path file" -Pending:($IsLinux -Or $IsOSX) {#https://github.com/PowerShell/PowerShell/issues/891 #[DRT][BugId(BugDatabase.WindowsOutOfBandReleases, 9058182)] "hello","world"|set-content testdrive:\dynamicfile2.txt $result=get-content testdrive:\dynamicfile2.txt