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

Rely toEqualFile fails on trailing newline #265

Open
ng-marcus opened this issue Jul 4, 2021 · 1 comment
Open

Rely toEqualFile fails on trailing newline #265

ng-marcus opened this issue Jul 4, 2021 · 1 comment

Comments

@ng-marcus
Copy link

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.

@bandersongit
Copy link
Contributor

Definitely not intentional, a PR would be appreciated!

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

No branches or pull requests

2 participants