Skip to content

Rely toEqualFile fails on trailing newline #265

@ng-marcus

Description

@ng-marcus

I'm using rely to test the output of a program (captured as a string) against the content of a file.

The test fails because the string ends with a newline but the file is read in with the final newline ignored. (My test file is a single line, ending in a newline)

I believe this is because of this implementation in Rely.IO

let readFile = (file: string): string => String.concat("\n", readLines(file));

I'm happy to make a PR to fix this, but just wanted to check this is not intentional behaviour.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions