Skip to content
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

Preparation for next release (4.2) #1055

Merged
merged 4 commits into from
Jan 19, 2024
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
5 changes: 3 additions & 2 deletions MoreLinq.Test/SequenceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ public void SequenceWithDescendingRangeDescendigStep(int start, int stop, int st
[TestCase(int.MinValue, int.MinValue, null)]
public void SequenceWithStartEqualsStop(int start, int stop, int? step)
{
var result = step.HasValue ? MoreEnumerable.Sequence(start, stop, step.Value)
: MoreEnumerable.Sequence(start, stop);
var result = step is { } someStep
? MoreEnumerable.Sequence(start, stop, someStep)
: MoreEnumerable.Sequence(start, stop);

Assert.That(start, Is.EqualTo(result.Single()));
}
Expand Down
10 changes: 3 additions & 7 deletions MoreLinq.Test/ToDataTableTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ sealed class TestObject(int key)
public override string ToString() => nameof(TestObject);
}


readonly IReadOnlyCollection<TestObject> testObjects;


public ToDataTableTest() =>
this.testObjects = Enumerable.Range(0, 3)
.Select(i => new TestObject(i))
Expand Down Expand Up @@ -172,16 +170,14 @@ public void ToDataTableWithSchema()
Assert.That(rows.Select(r => r["Value"]).ToArray(), Is.EqualTo(vars.Select(e => e.Value).ToArray()));
}

readonly struct Point
readonly struct Point(int x, int y)
{

#pragma warning disable CA1805 // Do not initialize unnecessarily (avoids CS0649)
public static Point Empty = new();
#pragma warning restore CA1805 // Do not initialize unnecessarily
public bool IsEmpty => X == 0 && Y == 0;
public int X { get; }
public int Y { get; }
public Point(int x, int y) : this() { X = x; Y = y; }
public int X { get; } = x;
public int Y { get; } = y;
}

[Test]
Expand Down
4 changes: 2 additions & 2 deletions MoreLinq.Test/TraceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public void TraceSequenceWithFormatter()
var trace = Lines(CaptureTrace(delegate
{
var formatter = CultureInfo.InvariantCulture;
new int?[] { 1234, null, 5678 }.Trace(n => n.HasValue
? n.Value.ToString("N0", formatter)
new int?[] { 1234, null, 5678 }.Trace(n => n is { } some
? some.ToString("N0", formatter)
: "#NULL")
.Consume();
}));
Expand Down
4 changes: 2 additions & 2 deletions MoreLinq/MoreLinq.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
<Copyright>$([System.Text.RegularExpressions.Regex]::Replace($(Copyright), `\s+`, ` `).Trim())</Copyright>
<AssemblyTitle>MoreLINQ</AssemblyTitle>
<NeutralLanguage>en-US</NeutralLanguage>
<VersionPrefix>4.1.0</VersionPrefix>
<VersionPrefix>4.2.0</VersionPrefix>
<Authors>MoreLINQ Developers.</Authors>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net8.0</TargetFrameworks>
<DebugType>portable</DebugType>
Expand All @@ -136,7 +136,7 @@
<PackageOutputPath>..\dist</PackageOutputPath>
<PackageReadmeFile>README.md</PackageReadmeFile>
<EnablePackageValidation>true</EnablePackageValidation>
<PackageValidationBaselineVersion>4.0.0</PackageValidationBaselineVersion>
<PackageValidationBaselineVersion>4.1.0</PackageValidationBaselineVersion>
<IncludeSymbols>true</IncludeSymbols>
<IncludeSource>true</IncludeSource>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
Expand Down