test_lineending.vim 438 B

1234567891011121314151617181920
  1. " Tests for saving/loading a file with some lines ending in
  2. " CTRL-M, some not
  3. func Test_lineending()
  4. let l = ["this line ends in a\<CR>",
  5. \ "this one doesn't",
  6. \ "this one does\<CR>",
  7. \ "and the last one doesn't"]
  8. set fileformat=dos
  9. enew!
  10. call append(0, l)
  11. $delete
  12. write Xfile1
  13. bwipe Xfile1
  14. edit Xfile1
  15. let t = getline(1, '$')
  16. call assert_equal(l, t)
  17. new | only
  18. call delete('Xfile1')
  19. endfunc