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
- PR has a meaningful title
- Use the present tense and imperative mood when describing your changes
- Summarized changes
- Change is not breaking
- Make sure all
.cs,.ps1and.psm1files have the correct copyright header - Make sure you've added a new test if existing tests do not effectively test the code changed and/or updated documentation
- This PR is ready to merge and is not Work in Progress.
- If the PR is work in progress, please add the prefix
WIP:to the beginning of the title and remove the prefix when the PR is ready.
- If the PR is work in progress, please add the prefix