◐ Shell
clean mode source ↗

Compatibility tests: Use correct test cases object and remove invalid test case by bergmeister · Pull Request #1440 · PowerShell/PSScriptAnalyzer

PR Summary

The $genericVerCases test case object was not being used due to what seems to have been a copy-paste error.
One test case actually did not work because having a version string with not dot would throw here

I could add the following negative test for it but was wondering why we cannot make it accept single character versions?

        It "Does not parse version string '7' due to missing dot" {
            { [Microsoft.PowerShell.CrossCompatibility.PowerShellVersion] '7' } | Should -Throw
        }

In the case of PowerShell Core we wouldn't even need our own implementation and just use System.Management.Automation.SemanticVersion, which can actually parse versions without a dot.

PR Checklist