Add a test for the ending-in-'\n' case and update tests for the other case.
To run the tests, point your browser to <yourdomainhere>/tests/frontend
<yourdomainhere>/tests/frontend
To run the tests, run bin/backendTests.sh
bin/backendTests.sh