Codex/issue 1446 core output tests#2447
Open
SarthakDudhe wants to merge 6 commits into
Open
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
For #1446, I added direct unit coverage for a core formatter helper instead of only testing the public beautify APIs.
What I changed:
Added js/test/core/test_output.js
Added python/jsbeautifier/tests/core/test_output.py
What the new tests do:
They cover the Output core class, which is responsible for building formatted output line by line.
The tests focus on ensure_empty_line_above, a low-level helper that decides whether a blank line should be inserted before the current output line.
They verify:
a blank line is inserted when the previous line does not match the requested prefix/suffix rules
no extra blank line is inserted when the previous line already matches the expected prefix
no extra blank line is inserted when the previous line already matches the expected suffix
This gives the repo real regression coverage for core output-spacing behavior in both the JavaScript and Python implementations.