Skip to content
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: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Global references are included in ALL projects in this repository
-->
<ItemGroup>
<GlobalPackageReference Include="Ubiquity.NET.Versioning.Build.Tasks" Version="5.0.5-alpha"/>
<GlobalPackageReference Include="Ubiquity.NET.Versioning.Build.Tasks" Version="5.0.6-alpha"/>

<!--
NOTE: This analyzer is sadly, perpetually in "pre-release" mode. There have been many issues/discussion on the point
Expand Down
4 changes: 2 additions & 2 deletions src/Ubiquity.NET.Versioning.UT/CSemVerCITests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ public void ToStringTests( )
var ver_beta = new CSemVerCI( new CSemVer(20, 1, 4, beta_1_0, ["buildMeta"]), testIndex, testName);
var ver_delta = new CSemVerCI( new CSemVer(20, 1, 4, delta_0_1, ["buildMeta"]), testIndex, testName);

Assert.AreEqual("20.1.5-alpha.ci.BuildIndex.BuildName+buildMeta", ver_alpha.ToString());
Assert.AreEqual("20.1.5-beta.1.ci.BuildIndex.BuildName+buildMeta", ver_beta.ToString());
Assert.AreEqual("20.1.5-alpha.0.0.ci.BuildIndex.BuildName+buildMeta", ver_alpha.ToString());
Assert.AreEqual("20.1.5-beta.1.0.ci.BuildIndex.BuildName+buildMeta", ver_beta.ToString());
Assert.AreEqual("20.1.5-delta.0.1.ci.BuildIndex.BuildName+buildMeta", ver_delta.ToString());
}

Expand Down
4 changes: 2 additions & 2 deletions src/Ubiquity.NET.Versioning.UT/PrereleaseVersionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ public void ToStringTest( )

string[] expectedSeq = ["beta", "0", "0"];
prv = new PrereleaseVersion( "beta", 0, 0 );
Assert.IsTrue( expectedSeq.SequenceEqual( prv.FormatElements( alawaysIncludeZero: true ) ) );
Assert.IsTrue( expectedSeq.SequenceEqual( prv.FormatElements( alwaysIncludeZero: true ) ) );

expectedSeq = ["beta"];
Assert.IsTrue( expectedSeq.SequenceEqual( prv.FormatElements( alawaysIncludeZero: false ) ) );
Assert.IsTrue( expectedSeq.SequenceEqual( prv.FormatElements( alwaysIncludeZero: false ) ) );
}
}
}
2 changes: 1 addition & 1 deletion src/Ubiquity.NET.Versioning/CSemVerCI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ private CSemVerCI( CSemVer patchP1, CSemVer baseBuild, ImmutableArray<string> ci
patchP1.Minor,
patchP1.Patch,
AlphaNumericOrdering.CaseInsensitive,
[ .. patchP1.PreRelease, .. ciSeq ],
[ .. patchP1.PrereleaseVersion?.FormatElements(alwaysIncludeZero: true) ?? patchP1.PreRelease, .. ciSeq ],
patchP1.BuildMeta
)
{
Expand Down
10 changes: 5 additions & 5 deletions src/Ubiquity.NET.Versioning/PrereleaseVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 +68,23 @@ public PrereleaseVersion( string preRelName, byte preRelNumber, byte preRelFix )
public string Name => CSemVerPrereleaseGrammar.ValidPrereleaseNames[ Index ];

/// <summary>Gets this <see cref="PrereleaseVersion"/> as a sequence of strings</summary>
/// <param name="alawaysIncludeZero">Indicates whether the result will always include zero values</param>
/// <param name="alwaysIncludeZero">Indicates whether the result will always include zero values</param>
/// <returns>Sequence of strings that represent this instance</returns>
/// <remarks>
/// The default behavior is to skip the <see cref="Number"/> value if it and the <see cref="Fix"/>
/// value are zero. <paramref name="alawaysIncludeZero"/> is used to override this and show the
/// value are zero. <paramref name="alwaysIncludeZero"/> is used to override this and show the
/// zero value always. (Normally this is only used for a <see cref="CSemVerCI"/>)
/// </remarks>
/// <seealso cref="SemVer.PreRelease"/>
/// <seealso cref="CSemVer"/>
/// <seealso cref="CSemVerCI"/>
public IEnumerable<string> FormatElements( bool alawaysIncludeZero = false )
public IEnumerable<string> FormatElements( bool alwaysIncludeZero = false )
{
yield return Name;
if(Number > 0 || Fix > 0 || alawaysIncludeZero)
if(Number > 0 || Fix > 0 || alwaysIncludeZero)
{
yield return Number.ToString( CultureInfo.InvariantCulture );
if(Fix >= 1 || alawaysIncludeZero)
if(Fix >= 1 || alwaysIncludeZero)
{
yield return Fix.ToString( CultureInfo.InvariantCulture );
}
Expand Down
Loading