Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
AppendLine-function
  • Loading branch information
pesse committed Feb 7, 2019
commit 90147719e687735e1c14b714ad5c33b95edd7bd4
4 changes: 4 additions & 0 deletions src/main/java/org/utplsql/cli/log/StringBlockFormatter.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ public void append( CharSequence seq ) {
content.append(seq);
}

public void appendLine( CharSequence seq ) {
content.append(seq).append("\n");
}

private int getMaxLength( String[] lines ) {
int len = 0;
for ( String line : lines ) {
Expand Down
4 changes: 3 additions & 1 deletion src/test/java/org/utplsql/cli/StringBlockFormatterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ void getBlockFormattedString() {
"#### Headline ####\n" +
"# #\n" +
"# My value 1 #\n" +
"# My val 2 #\n" +
"# #\n" +
"##################";

StringBlockFormatter formatter = new StringBlockFormatter("Headline");
formatter.append("My value 1");
formatter.appendLine("My value 1");
formatter.appendLine("My val 2");

assertEquals( expected, formatter.toString() );
}
Expand Down