diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/core/fileio_spec.lua | 23 | ||||
-rw-r--r-- | test/functional/legacy/autocmd_option_spec.lua | 7 | ||||
-rw-r--r-- | test/old/testdir/test_backspace_opt.vim | 18 | ||||
-rw-r--r-- | test/old/testdir/test_options.vim | 28 |
4 files changed, 46 insertions, 30 deletions
diff --git a/test/functional/core/fileio_spec.lua b/test/functional/core/fileio_spec.lua index d1236f2766..8de78234ce 100644 --- a/test/functional/core/fileio_spec.lua +++ b/test/functional/core/fileio_spec.lua @@ -45,6 +45,7 @@ describe('fileio', function() os.remove('Xtest-overwrite-forced') rmdir('Xtest_startup_swapdir') rmdir('Xtest_backupdir') + rmdir('Xtest_backupdir with spaces') end) it('fsync() codepaths #8304', function() @@ -132,6 +133,28 @@ describe('fileio', function() eq('foo', foo_contents); end) + it('backup with full path with spaces', function() + skip(is_ci('cirrus')) + clear() + mkdir('Xtest_backup with spaces') + command('set backup') + command('set backupdir=Xtest_backupdir\\ with\\ spaces//') + command('write Xtest_startup_file1') + feed('ifoo<esc>') + command('write') + feed('Abar<esc>') + command('write') + + -- Backup filename = fullpath, separators replaced with "%". + local backup_file_name = string.gsub(currentdir()..'/Xtest_startup_file1', + is_os('win') and '[:/\\]' or '/', '%%') .. '~' + local foo_contents = trim(read_file('Xtest_backupdir with spaces/'..backup_file_name)) + local foobar_contents = trim(read_file('Xtest_startup_file1')) + + eq('foobar', foobar_contents); + eq('foo', foo_contents); + end) + it('backup symlinked files #11349', function() skip(is_ci('cirrus')) clear() diff --git a/test/functional/legacy/autocmd_option_spec.lua b/test/functional/legacy/autocmd_option_spec.lua index 8f17f509f5..2d17439a78 100644 --- a/test/functional/legacy/autocmd_option_spec.lua +++ b/test/functional/legacy/autocmd_option_spec.lua @@ -542,13 +542,6 @@ describe('au OptionSet', function() expected_combination({'cursorcolumn', 0, 0, 0, 1, 'global', 'set'}) end) - it('with option value converted internally', function() - command('noa set backspace=1') - command('set backspace=2') - expected_combination(({ - 'backspace', 'indent,eol', 'indent,eol', 'indent,eol', '2', 'global', 'set' - })) - end) end) describe('with specific option', function() diff --git a/test/old/testdir/test_backspace_opt.vim b/test/old/testdir/test_backspace_opt.vim index 59e94d2898..78c51cb874 100644 --- a/test/old/testdir/test_backspace_opt.vim +++ b/test/old/testdir/test_backspace_opt.vim @@ -36,15 +36,15 @@ func Test_backspace_option() " NOTE: Vim doesn't check following error... "call assert_fails('set backspace-=ghi', 'E474:') - " Check backwards compatibility with version 5.4 and earlier - set backspace=0 - call assert_equal('0', &backspace) - set backspace=1 - call assert_equal('1', &backspace) - set backspace=2 - call assert_equal('2', &backspace) - set backspace=3 - call assert_equal('3', &backspace) + " " Check backwards compatibility with version 5.4 and earlier + " set backspace=0 + " call assert_equal('0', &backspace) + " set backspace=1 + " call assert_equal('1', &backspace) + " set backspace=2 + " call assert_equal('2', &backspace) + " set backspace=3 + " call assert_equal('3', &backspace) call assert_fails('set backspace=4', 'E474:') call assert_fails('set backspace=10', 'E474:') diff --git a/test/old/testdir/test_options.vim b/test/old/testdir/test_options.vim index 6390b9c37a..aabb11a76a 100644 --- a/test/old/testdir/test_options.vim +++ b/test/old/testdir/test_options.vim @@ -22,20 +22,20 @@ func Test_whichwrap() set whichwrap=h,h,h call assert_equal('h', &whichwrap) - " For compatibility with Vim 3.0 and before, number values are also - " supported for 'whichwrap' - set whichwrap=1 - call assert_equal('b', &whichwrap) - set whichwrap=2 - call assert_equal('s', &whichwrap) - set whichwrap=4 - call assert_equal('h,l', &whichwrap) - set whichwrap=8 - call assert_equal('<,>', &whichwrap) - set whichwrap=16 - call assert_equal('[,]', &whichwrap) - set whichwrap=31 - call assert_equal('b,s,h,l,<,>,[,]', &whichwrap) + " " For compatibility with Vim 3.0 and before, number values are also + " " supported for 'whichwrap' + " set whichwrap=1 + " call assert_equal('b', &whichwrap) + " set whichwrap=2 + " call assert_equal('s', &whichwrap) + " set whichwrap=4 + " call assert_equal('h,l', &whichwrap) + " set whichwrap=8 + " call assert_equal('<,>', &whichwrap) + " set whichwrap=16 + " call assert_equal('[,]', &whichwrap) + " set whichwrap=31 + " call assert_equal('b,s,h,l,<,>,[,]', &whichwrap) set whichwrap& endfunc |