microsoft / microsoft/vscode-java-test

Test output broken when strings contain newlines

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

Nobody has claimed this yet.

ai-triaged bug help wanted investigating junit low-priority test-reporting
Dominant language
TypeScript
Stars
340
Forks
173
Avg merge
1d 19h
Merged PRs (30d)
18

Description

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

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.

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.