]> granicus.if.org Git - vim/commitdiff
patch 8.1.0875: not all errors of marks and findfile()/finddir() are tested v8.1.0875
authorBram Moolenaar <Bram@vim.org>
Mon, 4 Feb 2019 20:14:45 +0000 (21:14 +0100)
committerBram Moolenaar <Bram@vim.org>
Mon, 4 Feb 2019 20:14:45 +0000 (21:14 +0100)
Problem:    Not all errors of marks and findfile()/finddir() are tested.
Solution:   Add more test coverage. (Dominique Pelle)

src/testdir/test_findfile.vim
src/testdir/test_marks.vim
src/version.c

index 78e51ed8369abeab22974c48ed1cf49d60e98742..0bae161a8b54c3a4757a6eb5560546a47dbf7fdd 100644 (file)
@@ -119,6 +119,14 @@ func Test_findfile()
   let &shellslash = save_shellslash
 endfunc
 
+func Test_findfile_error()
+  call assert_fails('call findfile([])', 'E730:')
+  call assert_fails('call findfile("x", [])', 'E730:')
+  call assert_fails('call findfile("x", "", [])', 'E745:')
+  call assert_fails('call findfile("x", "**x")', 'E343:')
+  call assert_fails('call findfile("x", repeat("x", 5000))', 'E854:')
+endfunc
+
 " Test finddir({name} [, {path} [, {count}]])
 func Test_finddir()
   let save_path = &path
@@ -167,3 +175,11 @@ func Test_finddir()
   let &path = save_path
   let &shellslash = save_shellslash
 endfunc
+
+func Test_finddir_error()
+  call assert_fails('call finddir([])', 'E730:')
+  call assert_fails('call finddir("x", [])', 'E730:')
+  call assert_fails('call finddir("x", "", [])', 'E745:')
+  call assert_fails('call finddir("x", "**x")', 'E343:')
+  call assert_fails('call finddir("x", repeat("x", 5000))', 'E854:')
+endfunc
index 2fb95a53627a9305d4f4fb4b02a351b4612b661c..a9bba578047ed0894c4e5af607b4dc803d45b063 100644 (file)
@@ -133,3 +133,44 @@ func Test_marks_cmd_multibyte()
 
   bwipe!
 endfunc
+
+func Test_delmarks()
+  new
+  norm mx
+  norm `x
+  delmarks x
+  call assert_fails('norm `x', 'E20:')
+
+  " Deleting an already deleted mark should not fail.
+  delmarks x
+
+  " Test deleting a range of marks.
+  norm ma
+  norm mb
+  norm mc
+  norm mz
+  delmarks b-z
+  norm `a
+  call assert_fails('norm `b', 'E20:')
+  call assert_fails('norm `c', 'E20:')
+  call assert_fails('norm `z', 'E20:')
+  call assert_fails('delmarks z-b', 'E475:')
+
+  call assert_fails('delmarks', 'E471:')
+  call assert_fails('delmarks /', 'E475:')
+
+  " Test delmarks!
+  norm mx
+  norm `x
+  delmarks!
+  call assert_fails('norm `x', 'E20:')
+  call assert_fails('delmarks! x', 'E474:')
+
+  bwipe!
+endfunc
+
+func Test_mark_error()
+  call assert_fails('mark', 'E471:')
+  call assert_fails('mark xx', 'E488:')
+  call assert_fails('mark _', 'E191:')
+endfunc
index 24a9fb31b039ea1f8e0427046e80e77aa65fd0bd..9b2e7c9f6d6f9271b0feefbe2012427609e7604e 100644 (file)
@@ -783,6 +783,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    875,
 /**/
     874,
 /**/