Skip to content

Commit

Permalink
Fixed compiler error
Browse files Browse the repository at this point in the history
  • Loading branch information
sakno committed Jan 23, 2024
1 parent 35ab7b4 commit a3b9e5b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/DotNext.Tests/IO/FileBufferingWriterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

namespace DotNext.IO;

using Buffers;

public sealed class FileBufferingWriterTests : Test
{
[Theory]
Expand Down Expand Up @@ -323,12 +325,12 @@ public static void CtorExceptions()
public static async Task WriteDuringReadAsync()
{
using var writer = new FileBufferingWriter();
writer.Write(new byte[] { 1, 2, 3 });
writer.Write(stackalloc byte[] { 1, 2, 3 });
using var manager = writer.GetWrittenContent();
Equal(new byte[] { 1, 2, 3 }, manager.Memory.ToArray());
Throws<InvalidOperationException>(writer.Clear);
Throws<InvalidOperationException>(writer.As<IGrowableBuffer<byte>>().Clear);
Throws<InvalidOperationException>(() => writer.WriteByte(2));
Throws<InvalidOperationException>(() => writer.GetWrittenContent());
Throws<InvalidOperationException>(writer.GetWrittenContent);
await ThrowsAsync<InvalidOperationException>(() => writer.WriteAsync(new byte[2], 0, 2));
await ThrowsAsync<InvalidOperationException>(writer.GetWrittenContentAsync().AsTask);
}
Expand Down

0 comments on commit a3b9e5b

Please sign in to comment.