From ed27f36223aac4ef43ae70c692fa498ea5af5f97 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 20 Dec 2019 15:32:50 -0800 Subject: [PATCH] Fix test failing when `UnixStat` feature is disabled (#11370) --- .../Microsoft.PowerShell.Utility/Get-FormatData.Tests.ps1 | 4 +++- test/powershell/engine/ETS/TypeTable.Tests.ps1 | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-FormatData.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-FormatData.Tests.ps1 index e4f71441b..727a228fd 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-FormatData.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-FormatData.Tests.ps1 @@ -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" { diff --git a/test/powershell/engine/ETS/TypeTable.Tests.ps1 b/test/powershell/engine/ETS/TypeTable.Tests.ps1 index 4b8fd759c..789c5c0e2 100644 --- a/test/powershell/engine/ETS/TypeTable.Tests.ps1 +++ b/test/powershell/engine/ETS/TypeTable.Tests.ps1 @@ -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'" {