Bram Moolenaar | 4a137b4 | 2017-08-04 22:37:11 +0200 | [diff] [blame] | 1 | " Tests for saving/loading a file with some lines ending in |
| 2 | " CTRL-M, some not |
Bram Moolenaar | 6d91bcb | 2020-08-12 18:50:36 +0200 | [diff] [blame] | 3 | |
Bram Moolenaar | 4a137b4 | 2017-08-04 22:37:11 +0200 | [diff] [blame] | 4 | func Test_lineending() |
| 5 | let l = ["this line ends in a\<CR>", |
| 6 | \ "this one doesn't", |
| 7 | \ "this one does\<CR>", |
| 8 | \ "and the last one doesn't"] |
| 9 | set ta tx |
| 10 | enew! |
| 11 | call append(0, l) |
| 12 | $delete |
| 13 | write Xfile1 |
| 14 | bwipe Xfile1 |
| 15 | edit Xfile1 |
| 16 | let t = getline(1, '$') |
| 17 | call assert_equal(l, t) |
| 18 | new | only |
| 19 | call delete('Xfile1') |
| 20 | endfunc |
Bram Moolenaar | 6d91bcb | 2020-08-12 18:50:36 +0200 | [diff] [blame] | 21 | |
| 22 | " vim: shiftwidth=2 sts=2 expandtab |