Skip to content

Commit c0711d4

Browse files
authored
Merge pull request #478 from filipw/bugfix/issue477
Handle version number with more than 3 subparts
2 parents fc8d8c4 + 241be60 commit c0711d4

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Dotnet.Script.DependencyModel/ProjectSystem/PackageVersion.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Dotnet.Script.DependencyModel.ProjectSystem
88
/// </summary>
99
public class PackageVersion : IEquatable<PackageVersion>
1010
{
11-
private static Regex IsPinnedRegex = new Regex(@"^(?>\[\d+[^,\]]+(?<!\.)\]|\d+\.\d+\.\d+)$", RegexOptions.Compiled);
11+
private static Regex IsPinnedRegex = new Regex(@"^(?>\[\d+[^,\]]+(?<!\.)\]|\d+(\.\d+){2,})$", RegexOptions.Compiled);
1212

1313
/// <summary>
1414
/// Initializes a new instance of the <see cref="PackageVersion"/> class.
@@ -29,7 +29,7 @@ public PackageVersion(string version)
2929
/// <summary>
3030
/// Gets a <see cref="bool"/> value that indicates whether the <see cref="PackageVersion"/> is "pinned".
3131
/// </summary>
32-
public bool IsPinned {get;}
32+
public bool IsPinned { get; }
3333

3434
/// <inheritdoc/>
3535
public bool Equals(PackageVersion other)

src/Dotnet.Script.Tests/PackageVersionTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public class PackageVersionTests
1111
{
1212
[Theory]
1313
[InlineData("1.2.3")]
14+
[InlineData("1.2.3.4")]
1415
[InlineData("[1.2]")]
1516
[InlineData("[1.2.3]")]
1617
[InlineData("[1.2.3-beta1]")]

0 commit comments

Comments
 (0)