Skip to content

Correct newline-style in json emitter #5418

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

davidBar-On
Copy link
Contributor

Suggested fix for issue #4273 - using the configured newline_style for the emitted JSON expected parts. The PR is based on back-porting PR #4743 (that was not merged into R2).

The approach taken is to propagate the newline-style setting by adding emit_formatted_file_with_line_style() function to the Emitter trait, and changing the default emit_formatted_file() to call it. All emit_formatted_file implementation were changed to emit_formatted_file_with_line_style, but the relevant code still calls emit_formatted_file. This is except for the JsonEmitter that calls emit_formatted_file_with_line_style directly with the newline-style setting, and the function is using it for the emitted expected parts.

Based on a comment to PR #4743, testings were added to writemode, to allow using test files.

@ytmimi ytmimi mentioned this pull request Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants