Skip to content

Commit 9014771

Browse files
committed
AppendLine-function
1 parent 9e572bd commit 9014771

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/main/java/org/utplsql/cli/log/StringBlockFormatter.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ public void append( CharSequence seq ) {
2323
content.append(seq);
2424
}
2525

26+
public void appendLine( CharSequence seq ) {
27+
content.append(seq).append("\n");
28+
}
29+
2630
private int getMaxLength( String[] lines ) {
2731
int len = 0;
2832
for ( String line : lines ) {

src/test/java/org/utplsql/cli/StringBlockFormatterTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ void getBlockFormattedString() {
1414
"#### Headline ####\n" +
1515
"# #\n" +
1616
"# My value 1 #\n" +
17+
"# My val 2 #\n" +
1718
"# #\n" +
1819
"##################";
1920

2021
StringBlockFormatter formatter = new StringBlockFormatter("Headline");
21-
formatter.append("My value 1");
22+
formatter.appendLine("My value 1");
23+
formatter.appendLine("My val 2");
2224

2325
assertEquals( expected, formatter.toString() );
2426
}

0 commit comments

Comments
 (0)