microsoft / vscode-java-test

Run and debug Java test cases in Visual Studio Code.
https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-test
Other
292 stars 125 forks source link

Test output broken when strings contain newlines #1626

Open TimKingtonFC opened 10 months ago

TimKingtonFC commented 10 months ago

It looks like something is wrong with the parsing of test failures when strings contain newlines.

If I do: assertEquals("if (x < 3){\n", "if (x < 3) {\n");

I get strange brackets in the output, and the plugin doesn't display the diff view that I normally get:

org.opentest4j.AssertionFailedError: expected: [if (x [ 3){
] but was: [if (x [ 3) {
]

At the command line, this works. I get:

expected:<if (x < 3)[]{
> but was:<if (x < 3)[ ]{
>

This is on MacOS 13.6, v0.40.0 of the runner, and vscode 1.83.1

jdneo commented 10 months ago

Looks like it has been addressed in latest Insider

Version: 1.84.0-insider (user setup) Commit: 7dff07893ac160244db210e574eccc05f1cba2cb Date: 2023-10-24T05:33:54.929Z Electron: 25.9.2 ElectronBuildId: 24603566 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Windows_NT x64 10.0.19045

with Test Runner for Java v0.40.2023101002

image

Would you mind verifying it works on your side with above product version?

jdneo commented 10 months ago

Oh, I got you.

The second test result is exactly the same as your description:

image