-
Notifications
You must be signed in to change notification settings - Fork 61
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
1 parent
2393517
commit a78287a
Showing
3 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters