Added additional testcases for trailingNewline

Includes test for 'true when newline already present' and 'single line
input'