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

Handle single-version-wide exact version range. #971

Merged
merged 1 commit into from
May 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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