Test output broken when strings contain newlines

Open
#1,626 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
java, typescript, vscode

Research direction

Reproduce the assertEquals case with newline-containing strings using the runner and VS Code versions described, then compare the plugin output with the command-line output. Trace how the runner parses the failure text; done means the malformed brackets are gone and the normal diff view appears.

Written by the indexing model from the issue text.

Description

ai-triaged bug help wanted investigating junit low-priority test-reporting

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

Dominant language
TypeScript
Stars
340
Forks
173
Avg merge
1d 2h
Merged PRs (30d)
17

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/vscode-java-test

All issues in microsoft/vscode-java-test

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.