diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-10-30 08:33:29 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-30 08:33:29 +0800 |
| commit | 75ec1b7208d4d8f38dff2adf4006de7ea82118d7 (patch) | |
| tree | 5f2c5122641a4da14ae67029e76737298623f775 /src/nvim/testdir | |
| parent | 8d38e1ad34552293de9e562b73c727ec119fd847 (diff) | |
| parent | 4158ad38ecb107cfe3d1dd7472cc9e17039f6ee2 (diff) | |
| download | rneovim-75ec1b7208d4d8f38dff2adf4006de7ea82118d7.tar.gz rneovim-75ec1b7208d4d8f38dff2adf4006de7ea82118d7.tar.bz2 rneovim-75ec1b7208d4d8f38dff2adf4006de7ea82118d7.zip | |
Merge pull request #20855 from zeertzjq/vim-fb0cf2357e0c
vim-patch:9.0.{0816,0819}: CTRL-Z at end of file is always dropped
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_fixeol.vim | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/nvim/testdir/test_fixeol.vim b/src/nvim/testdir/test_fixeol.vim index 32cb059e26..9d6c900bdb 100644 --- a/src/nvim/testdir/test_fixeol.vim +++ b/src/nvim/testdir/test_fixeol.vim @@ -1,16 +1,17 @@ -" Tests for 'fixeol' and 'eol' +" Tests for 'fixeol', 'eof' and 'eol' + func Test_fixeol() " first write two test files – with and without trailing EOL " use Unix fileformat for consistency set ff=unix enew! - call setline('.', 'with eol') + call setline('.', 'with eol or eof') w! XXEol enew! - set noeol nofixeol - call setline('.', 'without eol') + set noeof noeol nofixeol + call setline('.', 'without eol or eof') w! XXNoEol - set eol fixeol + set eol eof fixeol bwipe XXEol XXNoEol " try editing files with 'fixeol' disabled @@ -33,16 +34,18 @@ func Test_fixeol() w >>XXTestEol w >>XXTestNoEol - call assert_equal(['with eol', 'END'], readfile('XXEol')) - call assert_equal(['without eolEND'], readfile('XXNoEol')) - call assert_equal(['with eol', 'stays eol', 'END'], readfile('XXTestEol')) - call assert_equal(['without eol', 'stays withoutEND'], + call assert_equal(['with eol or eof', 'END'], readfile('XXEol')) + call assert_equal(['without eol or eofEND'], readfile('XXNoEol')) + call assert_equal(['with eol or eof', 'stays eol', 'END'], readfile('XXTestEol')) + call assert_equal(['without eol or eof', 'stays withoutEND'], \ readfile('XXTestNoEol')) call delete('XXEol') call delete('XXNoEol') call delete('XXTestEol') call delete('XXTestNoEol') - set ff& fixeol& eol& + set ff& fixeol& eof& eol& enew! endfunc + +" vim: shiftwidth=2 sts=2 expandtab |