summaryrefslogtreecommitdiff
path: root/src/testdir/test_viminfo.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-06-11 15:31:47 +0200
committerBram Moolenaar <Bram@vim.org>2016-06-11 15:31:47 +0200
commit62f8b4e18014b259bcde4a2845c602b0a44a3714 (patch)
tree76fc113d90ca646be2c912fca8e4128ca542a822 /src/testdir/test_viminfo.vim
parent012270936c3c7df3bba45ad2b48938c23a2fd43a (diff)
downloadvim-62f8b4e18014b259bcde4a2845c602b0a44a3714.zip
patch 7.4.1918
Problem: Not enough testing for parsing viminfo lines. Solution: Add test with viminfo lines in bad syntax. Fix memory leak.
Diffstat (limited to 'src/testdir/test_viminfo.vim')
-rw-r--r--src/testdir/test_viminfo.vim19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/testdir/test_viminfo.vim b/src/testdir/test_viminfo.vim
index 1fefba1b6..9d55600f9 100644
--- a/src/testdir/test_viminfo.vim
+++ b/src/testdir/test_viminfo.vim
@@ -201,3 +201,22 @@ func Test_viminfo_encoding()
call delete('Xviminfo')
endfunc
+
+func Test_viminfo_bad_syntax()
+ let lines = []
+ call add(lines, '|<') " empty continuation line
+ call add(lines, '|234234234234234324,nothing')
+ call add(lines, '|1+"no comma"')
+ call add(lines, '|1,2,3,4,5,6,7') " too many items
+ call add(lines, '|1,"string version"')
+ call add(lines, '|1,>x') " bad continuation line
+ call add(lines, '|1,"x') " missing quote
+ call add(lines, '|1,"x\') " trailing backslash
+ call add(lines, '|1,,,,') "trailing comma
+ call add(lines, '|1,>234') " trailing continuation line
+ call writefile(lines, 'Xviminfo')
+ call assert_fails('rviminfo Xviminfo', 'E685:')
+
+ call delete('Xviminfo')
+endfunc
+