Skip to content

Commit cc3f16c

Browse files
rjmholtRobert Holt
authored and
Robert Holt
committed
Fix test failure in PSv3/4
1 parent a8ef319 commit cc3f16c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Tests/Rules/UseCompatibleSyntax.Tests.ps1

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,16 @@ Describe "PSUseCompatibleSyntax" {
8484

8585
$diagnostics = Invoke-ScriptAnalyzer -IncludeRule PSUseCompatibleSyntax -Path "$PSScriptRoot/CompatibilityRuleAssets/IncompatibleScript.ps1" -Settings $settings
8686

87-
$diagnostics.Count | Should -Be 5
87+
if ($PSVersionTable.PSVersion.Major -ge 5)
88+
{
89+
$expected = 5
90+
}
91+
else
92+
{
93+
$expected = 4
94+
}
95+
96+
$diagnostics.Count | Should -Be $expected
8897
}
8998

9099
It "Ensures there are no incompatibilities in PSSA build files" {

0 commit comments

Comments
 (0)