def test__ensure_cr(): # Make sure text ends with carriage return assert _ensure_cr(' foo') == ' foo\n' assert _ensure_cr(' foo\n') == ' foo\n' assert _ensure_cr(' foo ') == ' foo\n' assert _ensure_cr('foo ') == 'foo\n' assert _ensure_cr('foo \n bar') == 'foo \n bar\n' assert _ensure_cr('foo \n\n') == 'foo\n'
def test__ensure_cr(): # Make sure text ends with carriage return assert_equal(_ensure_cr(' foo'), ' foo\n') assert_equal(_ensure_cr(' foo\n'), ' foo\n') assert_equal(_ensure_cr(' foo '), ' foo\n') assert_equal(_ensure_cr('foo '), 'foo\n') assert_equal(_ensure_cr('foo \n bar'), 'foo \n bar\n') assert_equal(_ensure_cr('foo \n\n'), 'foo\n')