Skip to content

Handle version number with more than 3 subparts #478

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 2, 2019
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Dotnet.Script.DependencyModel.ProjectSystem
/// </summary>
public class PackageVersion : IEquatable<PackageVersion>
{
private static Regex IsPinnedRegex = new Regex(@"^(?>\[\d+[^,\]]+(?<!\.)\]|\d+\.\d+\.\d+)$", RegexOptions.Compiled);
private static Regex IsPinnedRegex = new Regex(@"^(?>\[\d+[^,\]]+(?<!\.)\]|\d+(\.\d+){2,})$", RegexOptions.Compiled);

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

/// <inheritdoc/>
public bool Equals(PackageVersion other)
Expand Down
1 change: 1 addition & 0 deletions src/Dotnet.Script.Tests/PackageVersionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class PackageVersionTests
{
[Theory]
[InlineData("1.2.3")]
[InlineData("1.2.3.4")]
[InlineData("[1.2]")]
[InlineData("[1.2.3]")]
[InlineData("[1.2.3-beta1]")]
Expand Down