summaryrefslogtreecommitdiff
path: root/src/testdir/test_crypt.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-09-25 20:54:11 +0200
committerBram Moolenaar <Bram@vim.org>2016-09-25 20:54:11 +0200
commit680e015bfe19be6772d3bd754486fbd45c1a9d3b (patch)
tree1f786add42acb4835c366f0d5dc1cdddd53b6961 /src/testdir/test_crypt.vim
parent3f1c15b24a3939d193c80c509132db9ee4d8cceb (diff)
downloadvim-git-680e015bfe19be6772d3bd754486fbd45c1a9d3b.tar.gz
patch 8.0.0010v8.0.0010
Problem: Crash when editing file that starts with crypt yeader. (igor2x) Solution: Check for length of text. (Christian Brabandt) Add a test.
Diffstat (limited to 'src/testdir/test_crypt.vim')
-rw-r--r--src/testdir/test_crypt.vim42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/testdir/test_crypt.vim b/src/testdir/test_crypt.vim
new file mode 100644
index 000000000..10979dd33
--- /dev/null
+++ b/src/testdir/test_crypt.vim
@@ -0,0 +1,42 @@
+" Tests for encryption.
+" TODO: include tests from test71.
+
+func Common_head_only(text)
+ " This was crashing Vim
+ split Xtest.txt
+ call setline(1, a:text)
+ wq
+ call feedkeys(":split Xtest.txt\<CR>foobar\<CR>", "tx")
+ call delete('Xtest.txt')
+ call assert_match('VimCrypt', getline(1))
+ bwipe!
+endfunc
+
+func Test_head_only_2()
+ call Common_head_only('VimCrypt~02!abc')
+endfunc
+
+func Test_head_only_3()
+ call Common_head_only('VimCrypt~03!abc')
+endfunc
+" Tests for encryption.
+" TODO: include tests from test71.
+
+func Common_head_only(text)
+ " This was crashing Vim
+ split Xtest.txt
+ call setline(1, a:text)
+ wq
+ call feedkeys(":split Xtest.txt\<CR>foobar\<CR>", "tx")
+ call delete('Xtest.txt')
+ call assert_match('VimCrypt', getline(1))
+ bwipe!
+endfunc
+
+func Test_head_only_2()
+ call Common_head_only('VimCrypt~02!abc')
+endfunc
+
+func Test_head_only_3()
+ call Common_head_only('VimCrypt~03!abc')
+endfunc