Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Commit

Permalink
Handle single-version-wide exact version range. (#971)
Browse files Browse the repository at this point in the history
  • Loading branch information
skolima committed May 13, 2020
1 parent 9368062 commit b5e4b49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NuKeeper.Abstractions.Tests/NuGet/VersionRangesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class VersionRangesTests
{
[TestCase("1.2.3")]
[TestCase("1.2.3.4")]
[TestCase("[1.2.3.4]")]
[TestCase("1.2.3-beta04")]
[TestCase("1.2.3.4-beta05")]
public void ParseableToSingleVersion(string rangeString)
Expand Down Expand Up @@ -38,6 +39,7 @@ public void ParseableButNotSingleVersion(string rangeString)

[TestCase("1.2.3")]
[TestCase("1.2.3.4")]
[TestCase("[1.2.3.4]")]
[TestCase("1.2.3-beta04")]
[TestCase("1.2.3.4-beta05")]
public void ParseableToPackageIdentity(string rangeString)
Expand Down
2 changes: 1 addition & 1 deletion NuKeeper.Abstractions/NuGet/VersionRanges.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public static class VersionRanges
{
public static NuGetVersion SingleVersion(VersionRange range)
{
if (range == null || range.IsFloating || range.HasLowerAndUpperBounds)
if (range == null || range.IsFloating || range.HasLowerAndUpperBounds && range.MinVersion != range.MaxVersion)
{
return null;
}
Expand Down

0 comments on commit b5e4b49

Please sign in to comment.