Skip to content

Commit

Permalink
v18.1.0 - Fix initialization error in LimitedRange
Browse files Browse the repository at this point in the history
  • Loading branch information
monoman committed Apr 9, 2024
1 parent fb50234 commit c811ec8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ private static void AssertLimitedRange(LimitedRange lr, string text, bool isInva
Assert.That(lr.TextualRepresentation, Is.EqualTo(text));
string lrAsString = lr; // implicit string conversion
Assert.That(lrAsString, Is.EqualTo(text));
if (lr.IsEmpty)
Assert.That(lr.Count, Is.EqualTo((ushort)0), nameof(lr.Count));
else
Assert.That(lr.Count, Is.EqualTo((ushort)(lr.End - lr.Start + 1)), nameof(lr.Count));
} else if (!cause.IsBlank())
Assert.That(lr.InvalidityCause, Is.EqualTo(cause).IgnoreCase);
TestContext.WriteLine(lr.ToString());
Expand Down
4 changes: 2 additions & 2 deletions InterlockLedger.Commons/InterlockLedger.Commons.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<Product>InterlockLedger</Product>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/interlockledger/interlockledger-commons.git</RepositoryUrl>
<Version>18.0.0</Version>
<Version>18.1.0</Version>
<PackageId>InterlockLedger.Commons</PackageId>
<PackageReleaseNotes>IParsable reuse - Lots of BREAKING CHANGES</PackageReleaseNotes>
<PackageReleaseNotes>Fix initialization error in LimitedRange</PackageReleaseNotes>
<PackageIcon>il2.png</PackageIcon>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
Expand Down
2 changes: 2 additions & 0 deletions InterlockLedger.Commons/Types/System/LimitedRange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,12 @@ public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? prov
private LimitedRange(ulong start, ulong end, string textualRepresentation) {
Start = start;
End = end;
Count = (ushort)(end - start + 1);
TextualRepresentation = textualRepresentation;
}
private LimitedRange(string invalidityCause) {
Start = End = ulong.MaxValue;
Count = 0;
TextualRepresentation = "[?]";
InvalidityCause = invalidityCause;
}
Expand Down

0 comments on commit c811ec8

Please sign in to comment.