Prerequisites
Steps to reproduce
Affected version: All up to trunk.
There's a logic mismatch in PSVersionTable.Tests.ps1. More specifically, it tests here whether or not a commit build matches "^(\d+\.\d+\.\d+)(-.+)?" - and the issue is that GitCommitId absolutely can look like that and will indeed. See the comments here in PSVersionInfoGenerator.cs about how such a GitCommitId can look - but most importantly, it's ALWAYS prefixed by the version - and thus always matching the string it should not match.
As you can see, my GitCommitId after a clean build from the 7.6.2 git tag is 7.6.2-0-g0d3c290a8737d4252ee75c052d16190ffcdb7d19. This matches of course.
Expected behavior
Actual behavior
[-] GitCommitId property 3ms
Expected regular expression '^(\d+\.\d+\.\d+)(-.+)?-(\d+)-g(.+)$' to not match '7.6.2-0-g0d3c290a8737d4252ee75c052d16190ffcdb7d19', but it did match.
55: $PSVersionTable.GitCommitId | Should -Not -Match $unexpectectGitCommitIdPattern
at <ScriptBlock>, /home/aurutils/.cache/aurutils/sync/powershell/src/PowerShell/test/powershell/Host/PSVersionTable.Tests.ps1: line 55
Error details
Environment data
Name Value
---- -----
PSVersion 7.6.2
PSEdition Core
GitCommitId 7.6.2-0-g0d3c290a8737d4252ee75c052d16190ffcdb7d19
OS Arch Linux
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.4
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
No response
Prerequisites
Steps to reproduce
Affected version: All up to trunk.
There's a logic mismatch in
PSVersionTable.Tests.ps1. More specifically, it tests here whether or not a commit build matches"^(\d+\.\d+\.\d+)(-.+)?"- and the issue is thatGitCommitIdabsolutely can look like that and will indeed. See the comments here inPSVersionInfoGenerator.csabout how such aGitCommitIdcan look - but most importantly, it's ALWAYS prefixed by the version - and thus always matching the string it should not match.As you can see, my
GitCommitIdafter a clean build from the 7.6.2 git tag is7.6.2-0-g0d3c290a8737d4252ee75c052d16190ffcdb7d19. This matches of course.Expected behavior
No error.Actual behavior
Error details
Environment data
Visuals
No response