Skip to content

Commit cc93159

Browse files
authored
Merge pull request #296 from alepekhin/#285-fix-test-error
#285 Исправлена ошибка в проверяющем тесте в уроке Неизменяемость строк
2 parents 0a7cb19 + 52cea5f commit cc93159

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • modules/35-methods-using/115-string-immutability

modules/35-methods-using/115-string-immutability/Test.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ public static void main(String[] args) {
1414

1515
App.main(null);
1616

17-
final var actual = out.toString().trim();
17+
String answer = out.toString();
18+
if (answer != null && answer.endsWith("\n")) {
19+
// remove linefeed added by println
20+
answer = answer.substring(0, answer.length() - 1);
21+
}
22+
final var actual = answer;
1823

1924
System.setOut(new PrintStream(new FileOutputStream(FileDescriptor.out)));
2025
System.out.println(actual);

0 commit comments

Comments
 (0)