diff --git a/test/FindPSResourceTests/FindPSResourceLocal.Tests.ps1 b/test/FindPSResourceTests/FindPSResourceLocal.Tests.ps1 index ec0a9d873..1377cac2f 100644 --- a/test/FindPSResourceTests/FindPSResourceLocal.Tests.ps1 +++ b/test/FindPSResourceTests/FindPSResourceLocal.Tests.ps1 @@ -19,8 +19,10 @@ Describe 'Test Find-PSResource for local repositories' -tags 'CI' { $commandName = "cmd1" $dscResourceName = "dsc1" $prereleaseLabel = "" + $localNupkgRepo = "localNupkgRepo" Get-NewPSResourceRepositoryFile Register-LocalRepos + Register-LocalTestNupkgsRepo $localRepoUriAddress = Join-Path -Path $TestDrive -ChildPath "testdir" $tagsEscaped = @("'Test'", "'Tag2'", "'PSCommand_$cmdName'", "'PSDscResource_$dscName'") @@ -319,4 +321,14 @@ Describe 'Test Find-PSResource for local repositories' -tags 'CI' { $err.Count | Should -Not -Be 0 $err[0].FullyQualifiedErrorId | Should -BeExactly "FindTagsPackageNotFound,Microsoft.PowerShell.PSResourceGet.Cmdlets.FindPSResource" } + + It "find package where prerelease label includes digits and period (i.e prerelease label is not just words)" { + $nupkgName = "WebView2.Avalonia" + $nupkgVersion = "1.0.1518.46" + $prereleaseLabel = "preview.230207.17" + $res = Find-PSResource -Name $nupkgName -Prerelease -Repository $localNupkgRepo + $res.Name | Should -Be $nupkgName + $res.Version | Should -Be $nupkgVersion + $res.Prerelease | Should -Be $prereleaseLabel + } } diff --git a/test/testFiles/testNupkgs/webview2.avalonia.1.0.1518.46-preview.230207.17.nupkg b/test/testFiles/testNupkgs/webview2.avalonia.1.0.1518.46-preview.230207.17.nupkg new file mode 100644 index 000000000..e47c80773 Binary files /dev/null and b/test/testFiles/testNupkgs/webview2.avalonia.1.0.1518.46-preview.230207.17.nupkg differ