diff options
Diffstat (limited to 'src/testdir/test_crypt.vim')
-rw-r--r-- | src/testdir/test_crypt.vim | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/testdir/test_crypt.vim b/src/testdir/test_crypt.vim index ab62d8470..fa26ba550 100644 --- a/src/testdir/test_crypt.vim +++ b/src/testdir/test_crypt.vim @@ -110,3 +110,29 @@ func Test_crypt_key_mismatch() bwipe! endfunc +func Test_crypt_set_key_changes_buffer() + + new Xtest1.txt + call setline(1, 'nothing') + set cryptmethod=blowfish2 + call feedkeys(":X\<CR>foobar\<CR>foobar\<CR>", 'xt') + call assert_fails(":q", "E37:") + w + set key=anotherkey + call assert_fails(":bw") + w + call feedkeys(":X\<CR>foobar\<CR>foobar\<CR>", 'xt') + call assert_fails(":bw") + w + let winnr = winnr() + wincmd p + call setwinvar(winnr, '&key', 'yetanotherkey') + wincmd p + call assert_fails(":bw") + w + + set cryptmethod& + set key= + bwipe! + call delete('Xtest1.txt') +endfunc |