diff --git a/NuKeeper.Abstractions.Tests/NuGet/VersionRangesTests.cs b/NuKeeper.Abstractions.Tests/NuGet/VersionRangesTests.cs index 06552f527..299e30498 100644 --- a/NuKeeper.Abstractions.Tests/NuGet/VersionRangesTests.cs +++ b/NuKeeper.Abstractions.Tests/NuGet/VersionRangesTests.cs @@ -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) @@ -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) diff --git a/NuKeeper.Abstractions/NuGet/VersionRanges.cs b/NuKeeper.Abstractions/NuGet/VersionRanges.cs index 19a54e467..b457b3d67 100644 --- a/NuKeeper.Abstractions/NuGet/VersionRanges.cs +++ b/NuKeeper.Abstractions/NuGet/VersionRanges.cs @@ -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; }