Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Escape invalid XML chars in testCase and testSuite names (#284)
With a [ParameterizedTest](https://junit.org/junit5/docs/5.0.2/api/org/junit/jupiter/params/ParameterizedTest.html) it is possible to generate test case names with invalid XML characters. E.g. ``` @ParameterizedTest @valuesource(strings = {"Weird\bname"}) void testFoo(String input) { ... } ``` The test case name is derived from the input string, which in this case contains an invalid XML char `\b`. When tools (like IDEs) try to parse the junit XML, they'll fail due to the invalid char. Fix it by escaping test case names. It looks like [test suite names](https://junit.org/junit5/docs/5.0.3/api/org/junit/jupiter/api/DisplayName.html) could also contain invalid XML chars, so I'm escaping those as well. Closes #285
- Loading branch information