question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid linecoverage.xml file for Kotlin Test method names that use special symbols enclosed in backticks

See original GitHub issue

Tested with Pitest 1.9.3. Project runs on Kotlin 1.6.10

Issue

When setting exportLineCoverage to true Pitest generates an invalid linecoverage.xml file when there are “special symbols” in test method names enclosed in backticks (this is a best practices for writing tests in Kotlin), e.g. @Test fun `this won't work in pitest linecoverage file because of the single quote char`() {...}.

Known Workaround

Don’t use special symbols in test method names enclosed in backticks

Proposed Solution

Pitest should escape the special symbols <, >, &, ', " in the generated xml files

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
hcolescommented, Oct 4, 2022

@Pfoerd are you happy to close this?

1reaction
Pfoerdcommented, Oct 4, 2022

@hcoles successfully tested it with 1.9.7, it produces valid linecoverage.xml files also for tests with lambdas/inlines like above. Thx!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kotlin test code using backtick test method names has case ...
Since it's valid in Kotlin to have these two as separate methods you would expect both methods to execute appropriately. Actual: java.lang.
Read more >
Does Kotlin allow the use of backtick names for test classes?
As gotube says, the Kotlin coding conventions specifically allow test method names with spaces. But they don't require it; you're free to ...
Read more >
pitest - Bountysource
When setting exportLineCoverage to true Pitest generates an invalid linecoverage.xml file when there are "special symbols" in test method names enclosed in ...
Read more >
Android issue with backticked method names
I started to use kotlin for frontend game development. After a while I tried to run my game in android, but it didn't...
Read more >
IntelliJ IDEA 183.3975.8 Beta Release Notes | Knowledge Base
Feature IDEA‑132487 External annotations for java third party libraries Feature IDEA‑196706 Multithread model for new SE Feature IDEA‑127245 Open all files from favorites list Bug IDEA‑113988...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found