Skip to content

Commit

Permalink
feat: allow manually clearing the captured output
Browse files Browse the repository at this point in the history
Signed-off-by: niliha <75397148+niliha@users.noreply.github.com>
  • Loading branch information
niliha authored and joke committed Mar 11, 2024
1 parent 22b8b0c commit ad73542
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ public interface CapturedOutput {

List<String> getLines();

void clear();

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ public List<String> getLines() {
return asList(buffer.toString().split("(\\r\\n|\\n|\\r)"));
}

@Override
public void clear() {
buffer.setLength(0);
}

synchronized StringBuffer append(String str) {
return buffer.append(str);
}
Expand Down

0 comments on commit ad73542

Please sign in to comment.