Skip to content

Does InputStream need to be home-made? #17

@ashleyfrieze

Description

@ashleyfrieze

Please see PR #16 in which I replaced the implementation of the input stream with something from the default Java API. I don't see why the home-made implementation is better, but it has a surprising effect, which is the reason I've raised this PR.

Why does the original version of the unit test work? The first scanner should, on nextLine, fast forward through the text to cache some of the line after? In the original code it doesn't, meaning that the test is able to pass. However, I think the test should not pass (it doesn't with this refactor) and the replacement test is more correct.

I also changed the README where I found it slightly hard to understand why you were asserting the second line, but it seemed simpler when we assert both first and second line.

This may or may not seem like an improvement. Just sharing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions