Add OutputFormat utility for vertical side-by-side collection formatting for assertion failure outputAdd OutputFormat utility for vertical side-by-side collection formatting for assertion failure outputCreate OutputFormat.java #4884
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a new
OutputFormat
utility class to the JUnit Jupiter API that provides enhanced formatting capabilities for assertion failure messages. This addresses issue #3593 by introducing vertical side-by-side collection formatting as a building block for improved assertion diff output.Changes
OutputFormat
inorg.junit.jupiter.api
packageofVertical(Collection<?> expected, Collection<?> actual)
- creates a Supplier that formats two collections side-by-side verticallyUsage
The
OutputFormat.ofVertical()
method serves as a building block for improved assertion diff output, making it easier to visually compare collections in test failures.Related Issue
References #3593
I hereby agree to the terms of the JUnit Contributor License Agreement.
Definition of Done
@API
annotationsThis class provides formatting utilities for assertion failure output, specifically:
The vertical format makes it easy to visually compare expected vs actual collections in test failures.
I hereby agree to the terms of the JUnit Contributor License Agreement.
Definition of Done
@API
annotations