diff options
Diffstat (limited to 'test/functional/legacy/fixeol_spec.lua')
-rw-r--r-- | test/functional/legacy/fixeol_spec.lua | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/test/functional/legacy/fixeol_spec.lua b/test/functional/legacy/fixeol_spec.lua index bba1415535..50236e8617 100644 --- a/test/functional/legacy/fixeol_spec.lua +++ b/test/functional/legacy/fixeol_spec.lua @@ -2,15 +2,16 @@ local helpers = require('test.functional.helpers')(after_each) local feed = helpers.feed -local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect +local clear, feed_command, expect = helpers.clear, helpers.feed_command, helpers.expect describe('fixeol', function() local function rmtestfiles() - os.remove('test.out') - os.remove('XXEol') - os.remove('XXNoEol') - os.remove('XXTestEol') - os.remove('XXTestNoEol') + feed_command('%bwipeout!') + feed_command('call delete("test.out")') + feed_command('call delete("XXEol")') + feed_command('call delete("XXNoEol")') + feed_command('call delete("XXTestEol")') + feed_command('call delete("XXTestNoEol")') end setup(function() clear() @@ -23,38 +24,38 @@ describe('fixeol', function() it('is working', function() -- First write two test files – with and without trailing EOL. -- Use Unix fileformat for consistency. - execute('set ff=unix') - execute('enew!') + feed_command('set ff=unix') + feed_command('enew!') feed('awith eol<esc>:w! XXEol<cr>') - execute('enew!') - execute('set noeol nofixeol') + feed_command('enew!') + feed_command('set noeol nofixeol') feed('awithout eol<esc>:w! XXNoEol<cr>') - execute('set eol fixeol') - execute('bwipe XXEol XXNoEol') + feed_command('set eol fixeol') + feed_command('bwipe XXEol XXNoEol') -- Try editing files with 'fixeol' disabled. - execute('e! XXEol') + feed_command('e! XXEol') feed('ostays eol<esc>:set nofixeol<cr>') - execute('w! XXTestEol') - execute('e! XXNoEol') + feed_command('w! XXTestEol') + feed_command('e! XXNoEol') feed('ostays without<esc>:set nofixeol<cr>') - execute('w! XXTestNoEol') - execute('bwipe XXEol XXNoEol XXTestEol XXTestNoEol') - execute('set fixeol') + feed_command('w! XXTestNoEol') + feed_command('bwipe XXEol XXNoEol XXTestEol XXTestNoEol') + feed_command('set fixeol') -- Append "END" to each file so that we can see what the last written char was. feed('ggdGaEND<esc>:w >>XXEol<cr>') - execute('w >>XXNoEol') - execute('w >>XXTestEol') - execute('w >>XXTestNoEol') + feed_command('w >>XXNoEol') + feed_command('w >>XXTestEol') + feed_command('w >>XXTestNoEol') -- Concatenate the results. - execute('e! test.out') + feed_command('e! test.out') feed('a0<esc>:$r XXEol<cr>') - execute('$r XXNoEol') + feed_command('$r XXNoEol') feed('Go1<esc>:$r XXTestEol<cr>') - execute('$r XXTestNoEol') - execute('w') + feed_command('$r XXTestNoEol') + feed_command('w') -- Assert buffer contents. expect([=[ |