diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2019-04-30 12:24:56 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-30 12:24:56 +0200 |
| commit | 8342b4486b43e6664b6412ac0c8a549097220df2 (patch) | |
| tree | 7b892b17acbcac5e8298b641e336ee7de05647dd /src/nvim/testdir | |
| parent | 63526f2eeee774c657270a1ec0cbd788480f14b7 (diff) | |
| parent | 0e7048ae0558e457d37ce2d13dc5f1f9e62deb49 (diff) | |
| download | rneovim-8342b4486b43e6664b6412ac0c8a549097220df2.tar.gz rneovim-8342b4486b43e6664b6412ac0c8a549097220df2.tar.bz2 rneovim-8342b4486b43e6664b6412ac0c8a549097220df2.zip | |
Merge #9957 from janlazo/vim-8.0.1263
vim-patch:8.0.{1263,1265,1267}
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_swap.vim | 36 | ||||
| -rw-r--r-- | src/nvim/testdir/test_undo.vim | 1 |
2 files changed, 37 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_swap.vim b/src/nvim/testdir/test_swap.vim index 4dc8803a2a..3db438cf4b 100644 --- a/src/nvim/testdir/test_swap.vim +++ b/src/nvim/testdir/test_swap.vim @@ -51,6 +51,42 @@ func Test_swap_directory() call delete("Xtest.je", "rf") endfunc +func Test_swap_group() + if !has("unix") + return + endif + let groups = split(system('groups')) + if len(groups) <= 1 + throw 'Skipped: need at least two groups, got ' . string(groups) + endif + + try + call delete('Xtest') + split Xtest + call setline(1, 'just some text') + wq + if system('ls -l Xtest') !~ ' ' . groups[0] . ' \d' + throw 'Skipped: test file does not have the first group' + else + silent !chmod 640 Xtest + call system('chgrp ' . groups[1] . ' Xtest') + if system('ls -l Xtest') !~ ' ' . groups[1] . ' \d' + throw 'Skipped: cannot set second group on test file' + else + split Xtest + let swapname = substitute(execute('swapname'), '[[:space:]]', '', 'g') + call assert_match('Xtest', swapname) + " Group of swapfile must now match original file. + call assert_match(' ' . groups[1] . ' \d', system('ls -l ' . swapname)) + + bwipe! + endif + endif + finally + call delete('Xtest') + endtry +endfunc + func Test_missing_dir() call mkdir('Xswapdir') exe 'set directory=' . getcwd() . '/Xswapdir' diff --git a/src/nvim/testdir/test_undo.vim b/src/nvim/testdir/test_undo.vim index 9729ca9f57..beb44f9699 100644 --- a/src/nvim/testdir/test_undo.vim +++ b/src/nvim/testdir/test_undo.vim @@ -242,6 +242,7 @@ func Test_undojoin() endfunc func Test_undo_write() + call delete('Xtest') split Xtest call feedkeys("ione one one\<Esc>", 'xt') w! |