Skip to content

Commit

Permalink
Fix tests regarding os specific line endings (#399)
Browse files Browse the repository at this point in the history
On Windows two tests fail because additional
\r chars are being used for new lines.
To fix this issue those chars are being
removed from exception texts.

Signed-off-by: Michael Schäfer <[email protected]>
  • Loading branch information
mschaefer88 authored and jonahgraham committed Jan 24, 2020
1 parent 4e476ba commit 5ad981b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public CompletableFuture<Object> request(String method, Object parameter) {
assertEquals(ResponseErrorCode.InternalError.getValue(), response.getError().getCode());
String exception = (String) response.getError().getData();
String expected = "java.lang.RuntimeException: BAAZ\n\tat org.eclipse.lsp4j.jsonrpc.test.RemoteEndpointTest";
assertEquals(expected, exception.substring(0, expected.length()));
assertEquals(expected, exception.replaceAll("\\r", "").substring(0, expected.length()));
} finally {
logMessages.unregister();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class LSPEndpointTest {
assertEquals('''
Lists must not contain null references. Path: $.result.contents[0]
Lists must not contain null references. Path: $.result.contents[1]
'''.toString.trim, exception.cause.message)
'''.toString.replaceAll("\\r", "").trim, exception.cause.message)
assertFalse(future.isDone)
} finally {
in.close()
Expand Down

0 comments on commit 5ad981b

Please sign in to comment.