Skip to content
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

Update StdOutputStream to keep trailing empty lines #754

Merged
merged 10 commits into from
Nov 7, 2023
Merged

Conversation

Michael1993
Copy link
Member

@Michael1993 Michael1993 commented Sep 7, 2023

Closes #750

Proposed commit message:

${action} (${issues} / ${pull-request}) [max 70 characters]

${body} [max 70 characters per line]

${references}: ${issues}
PR: ${pull-request}

PR checklist

The following checklist shall help the PR's author, the reviewers and maintainers to ensure the quality of this project.
It is based on our contributors guidelines, especially the "writing code" section.
It shall help to check for completion of the listed points.
If a point does not apply to the given PR's changes, the corresponding entry can be simply marked as done.

Documentation (general)

  • There is documentation (Javadoc and site documentation; added or updated)
  • There is implementation information to describe why a non-obvious source code / solution got implemented
  • Site documentation has its own .adoc file in the docs folder, e.g. docs/report-entries.adoc
  • Site documentation in .adoc file references demo in src/demo/java instead of containing code blocks as text
  • Only one sentence per line (especially in .adoc files)
  • Javadoc uses formal style, while sites documentation may use informal style

Documentation (new extension)

  • The docs/docs-nav.yml navigation has an entry for the new extension
  • The package-info.java contains information about the new extension

Code

  • Code adheres to code style, naming conventions etc.
  • Successful tests cover all changes
  • There are checks which validate correct / false usage / configuration of a functionality and there are tests to verify those checks
  • Tests use AssertJ or our own PioneerAssert (which are based on AssertJ)

Contributing

  • A prepared commit message exists
  • The list of contributions inside README.md mentions the new contribution (real name optional)

Copy link
Member

@Bukama Bukama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put a nice commit message on it and you are ready to merge :)

@nipafx
Copy link
Member

nipafx commented Sep 14, 2023

After a lot of qualms, I settled on the basic assumption that every line, whether printed to System.out or read from System.in, ends with a newline (except with System.out.print). That leads to:

  • print("Foo") ~> ...
    • capturedString: "Foo"
    • capturedLines: [ "Foo" ]
  • println("Foo") ~> ...
    • capturedString: "Foo%n"
    • capturedLines: [ "Foo" ]
  • println("Foo"), println() ~> ...
    • capturedString: "Foo%n%n"
    • capturedLines: [ "Foo", "" ]
  • readln: "Foo" ~> ...
    • capturedString: "Foo%n"
    • capturedLines: [ "Foo" ]
  • readln: "Foo", "" ~> ...
    • capturedString: "Foo%n%n"
    • capturedLines: [ "Foo", "" ]

The new behavior still needs to be documented. And the issue needs to prominently explain that the behavior changed and what the fix is. We can later copy-paste that to the release notes.

@nipafx
Copy link
Member

nipafx commented Oct 29, 2023

I described the behavior in the feature doc. Can you take a look @Michael1993?

Once we agree on the phrasing and details in the there, we can expand it to the Javadoc (or at least add a reference there) and issue, so we have something to copy to the release notes.

Copy link
Member Author

@Michael1993 Michael1993 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation looks fine to me.

@nipafx nipafx added the full-build Triggers full build suite on PR label Nov 7, 2023
@nipafx nipafx merged commit 299a874 into main Nov 7, 2023
44 checks passed
@nipafx nipafx deleted the issue/750-stdout branch November 7, 2023 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
full-build Triggers full build suite on PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

StdOutputStream final linefeed ambiguity.
3 participants