Skip to content

Commit

Permalink
Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
electricessence committed Nov 11, 2024
1 parent 0feb5d3 commit 96d4cd4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 0 additions & 2 deletions Open.ChannelExtensions.Tests/BatchTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Runtime.CompilerServices;
using System.Threading.Channels;
using System.Threading;

namespace Open.ChannelExtensions.Tests;

Expand Down
14 changes: 8 additions & 6 deletions Open.ChannelExtensions.Tests/PipelineExceptionTests.cs
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
using System.Threading.Tasks;
using System.Xml.Linq;

namespace Open.ChannelExtensions.Tests;
namespace Open.ChannelExtensions.Tests;
public class PipelineExceptionTests
{
const int BatchSize = 20;
const int Elements = 100;
readonly Channel<int> _channel;

#pragma warning disable IDE0052 // Remove unread private members
// for debugging
int _thrown = -2;
#pragma warning restore IDE0052 // Remove unread private members

public PipelineExceptionTests()
{
_channel = Channel.CreateBounded<int>(10000);
for (var i = 0; i < 100; i++)
{
if (!_channel.Writer.TryWrite(i))
throw new Exception("Failed to write " + i);
throw new Exception($"Failed to write {i}");
}
}

Func<int, int> CreateThrowIfEqual(int elementToThrow) => element =>
{
if (elementToThrow != -1 && element != elementToThrow)
return element;

_thrown = element;
throw new Exception("Thrown at " + element);
throw new Exception($"Thrown at {element}");
};

ChannelReader<int> PrepareStage1(int elementToThrow) =>
Expand Down
2 changes: 1 addition & 1 deletion Open.ChannelExtensions/Open.ChannelExtensions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<PackageIcon>logo.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<!-- Don't enforce collection expressions as they don't work in .NET 6. -->
<NoWarn>IDE0301;IDE0303;IDE0304</NoWarn>
<NoWarn>IDE0130;IDE0301;IDE0303;IDE0304;</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 96d4cd4

Please sign in to comment.