Skip to content

Codex/issue 1446 core output tests#2447

Open
SarthakDudhe wants to merge 6 commits into
beautifier:mainfrom
SarthakDudhe:codex/issue-1446-core-output-tests
Open

Codex/issue 1446 core output tests#2447
SarthakDudhe wants to merge 6 commits into
beautifier:mainfrom
SarthakDudhe:codex/issue-1446-core-output-tests

Conversation

@SarthakDudhe
Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant