Skip to content

Commit

Permalink
Fix existing unit tests regarding versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Démoulins committed Oct 22, 2017
1 parent bff6b61 commit c6e2714
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion AU/Private/AUVersion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ class AUVersion : System.IComparable {

hidden static [string] GetPattern([bool] $strict) {
$versionPattern = '(?<version>\d+(?:\.\d+){0,3})'
$identifierPattern = "[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*"
# for now, chocolatey does only support SemVer v1 (no dot separated identifiers in pre-release):
$identifierPattern = "[0-9A-Za-z-]+"
# here is the SemVer v2 equivalent:
#$identifierPattern = "[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*"
if ($strict) {
return "^$versionPattern(?:-(?<prerelease>$identifierPattern))?(?:\+(?<buildMetadata>$identifierPattern))?`$"
} else {
Expand Down
2 changes: 1 addition & 1 deletion tests/Update-Package.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ Describe 'Update-Package' -Tag update {

update *> $null

$global:Latest.NuspecVersion | Should Be 0.0
$global:Latest.NuspecVersion | Should Be '0.0'
}
}

Expand Down

0 comments on commit c6e2714

Please sign in to comment.