-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Proc.StartLongRunning allows you to yield after waiting for started. (#…
…16) Without necessarily killing the process (unless disposing the long running subscription). Its now also easier to stop buffering process output after started handler (optional)
- Loading branch information
Showing
5 changed files
with
71 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System; | ||
using System.Text; | ||
using ProcNet.Std; | ||
using Xunit.Abstractions; | ||
|
||
public class TestConsoleOutWriter(ITestOutputHelper output) : IConsoleOutWriter | ||
{ | ||
private readonly StringBuilder _sb = new(); | ||
public string[] Lines => _sb.ToString().Replace("\r\n", "\n").Split(new [] {"\n"}, StringSplitOptions.None); | ||
public string Text => _sb.ToString(); | ||
|
||
public void Write(Exception e) => throw e; | ||
|
||
public void Write(ConsoleOut consoleOut) | ||
{ | ||
consoleOut.CharsOrString(c => _sb.Append(new string(c)), s => _sb.AppendLine(s)); | ||
consoleOut.CharsOrString(c => output.WriteLine(new string(c)), output.WriteLine); | ||
} | ||
} |