Exemplo n.º 1
0
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'
Exemplo n.º 2
0
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')