add failing test for #353
tests: minor edits for conciseness
Fix handling of EOF whitespace.

New behavior:
1. If file ends with no whitespace, it appends a single newline at the end of file.
2. If file ends with whitespace, it replaces all trailing whitespace with a single newline.

Closes #353.
add test for EOL whitespace.
Merge pull request #797 from prose/issue353

Fix handling of EOF whitespace.