Fix test failing when UnixStat feature is disabled (#11370)

This commit is contained in:
Aditya Patwardhan 2019-12-20 15:32:50 -08:00 committed by GitHub
parent 1f9c3c2abd
commit ed27f36223
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -15,7 +15,9 @@ Describe "Get-FormatData" -Tags "CI" {
$format.TypeNames | Should -HaveCount 2
$format.TypeNames[0] | Should -BeExactly "System.IO.DirectoryInfo"
$format.TypeNames[1] | Should -BeExactly "System.IO.FileInfo"
$format.FormatViewDefinition | Should -HaveCount ($IsWindows ? 4 : 5)
$isUnixStatEnabled = $EnabledExperimentalFeatures -contains 'PSUnixFileStat'
$format.FormatViewDefinition | Should -HaveCount ( $isUnixStatEnabled ? 5 : 4)
}
It "Should return nothing for format data requiring '-PowerShellVersion 5.1' and not provided" {

View file

@ -18,7 +18,8 @@ Describe "Built-in type information tests" -Tag "CI" {
}
It "Should have correct number of built-in type items in type table" {
$types.Count | Should -BeExactly ($IsWindows ? 273 : 272)
$isUnixStatEnabled = $EnabledExperimentalFeatures -contains 'PSUnixFileStat'
$types.Count | Should -BeExactly ($isUnixStatEnabled ? 272 : 273)
}
It "Should have expected member info for 'System.Diagnostics.ProcessModule'" {