diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-05-21 01:06:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-21 01:06:31 +0200 |
commit | ca1ce590257c35426aeeaac349317d2cb163cd2e (patch) | |
tree | 04f75eccd24174f4723274a7505874d822363b9a /test/functional/core/fileio_spec.lua | |
parent | b9ba1295b466a440600b36a717c701bfcea53dbc (diff) | |
parent | 5b04a4fa09e0ee09678aec23b1d0233e7c25e3e6 (diff) | |
download | rneovim-ca1ce590257c35426aeeaac349317d2cb163cd2e.tar.gz rneovim-ca1ce590257c35426aeeaac349317d2cb163cd2e.tar.bz2 rneovim-ca1ce590257c35426aeeaac349317d2cb163cd2e.zip |
Merge #9709 'fileio: use os_copy to create backups'
ref #8288
Diffstat (limited to 'test/functional/core/fileio_spec.lua')
-rw-r--r-- | test/functional/core/fileio_spec.lua | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/functional/core/fileio_spec.lua b/test/functional/core/fileio_spec.lua index 09533e4e60..c74eb3bb02 100644 --- a/test/functional/core/fileio_spec.lua +++ b/test/functional/core/fileio_spec.lua @@ -10,6 +10,8 @@ local request = helpers.request local retry = helpers.retry local rmdir = helpers.rmdir local sleep = helpers.sleep +local read_file = helpers.read_file +local trim = helpers.trim describe('fileio', function() before_each(function() @@ -18,6 +20,7 @@ describe('fileio', function() command(':qall!') os.remove('Xtest_startup_shada') os.remove('Xtest_startup_file1') + os.remove('Xtest_startup_file1~') os.remove('Xtest_startup_file2') rmdir('Xtest_startup_swapdir') end) @@ -64,5 +67,25 @@ describe('fileio', function() command('write') eq(4, request('nvim__stats').fsync) end) + + it('backup #9709', function() + clear({ args={ '-i', 'Xtest_startup_shada', + '--cmd', 'set directory=Xtest_startup_swapdir' } }) + + command('write Xtest_startup_file1') + feed('ifoo<esc>') + command('set backup') + command('set backupcopy=yes') + command('write') + feed('Abar<esc>') + command('write') + + local foobar_contents = trim(read_file('Xtest_startup_file1')) + local bar_contents = trim(read_file('Xtest_startup_file1~')) + + eq('foobar', foobar_contents); + eq('foo', bar_contents); + + end) end) |