feat: add system.buffers support for pipe target
Some checks failed
default / dotnet-default-workflow (pull_request) Failing after 44s
Some checks failed
default / dotnet-default-workflow (pull_request) Failing after 44s
This commit is contained in:
parent
461a5b9066
commit
d3e42f5c64
2 changed files with 37 additions and 0 deletions
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
using System.Text;
|
||||
using System.IO.Pipelines;
|
||||
using System.Buffers;
|
||||
|
||||
using Geekeey.Process.Buffered;
|
||||
|
||||
|
|
@ -619,6 +620,19 @@ internal sealed class PipingTests
|
|||
await Assert.That(output.Length).IsEqualTo(100_000);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task I_can_execute_a_command_and_pipe_the_stdout_to_a_buffer_writer()
|
||||
{
|
||||
var output = new ArrayBufferWriter<byte>();
|
||||
var cmd = new Command(Testing.Fixture.Program.FilePath)
|
||||
.WithArguments(["generate", "blob", "--length", "100000"]) |
|
||||
PipeTarget.ToBufferWriter(output);
|
||||
|
||||
await cmd.ExecuteAsync();
|
||||
|
||||
await Assert.That(output.WrittenCount).IsEqualTo(100_000);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task I_can_execute_a_command_and_pipe_the_stdout_into_multiple_hierarchical_targets()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue