Merge pull request #2793 from anivanovic/wrong_line_separator

Append system default new line when generating code.
This commit is contained in:
Jan-Willem Gmelig Meyling 2021-06-02 09:45:23 +02:00 committed by GitHub
commit 8c900c99cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -93,7 +93,7 @@ public abstract class AbstractCodeWriter<T extends AbstractCodeWriter<T>> implem
@Override
public T nl() throws IOException {
return append("\n");
return append(System.lineSeparator());
}
}

View File

@ -55,7 +55,7 @@ public class JavaWriterTest {
textBuilder.append((char) c);
}
}
String expected = textBuilder.toString().replace("\r\n", "\n").trim();
String expected = textBuilder.toString().replace("\r\n", System.lineSeparator()).trim();
String actual = text.trim();
assertEquals(expected, actual);
}