]> granicus.if.org Git - vim/commitdiff
patch 8.1.1199: no test for :abclear v8.1.1199
authorBram Moolenaar <Bram@vim.org>
Tue, 23 Apr 2019 14:36:05 +0000 (16:36 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 23 Apr 2019 14:36:05 +0000 (16:36 +0200)
Problem:    No test for :abclear.
Solution:   Add a test. (Dominique Pelle, closes #4292)

src/testdir/test_mapping.vim
src/version.c

index 61a1edd4ad978fc739ef7c6903db8557b236b697..a361b2fdc8dec463733cb9efa69c5551533a978f 100644 (file)
@@ -11,6 +11,62 @@ func Test_abbreviation()
   set nomodified
 endfunc
 
+func Test_abclear()
+   abbrev foo foobar
+   iabbrev fooi foobari
+   cabbrev fooc foobarc
+   call assert_equal("\n\n"
+         \        .. "c  fooc          foobarc\n"
+         \        .. "i  fooi          foobari\n"
+         \        .. "!  foo           foobar", execute('abbrev'))
+
+   iabclear
+   call assert_equal("\n\n"
+         \        .. "c  fooc          foobarc\n"
+         \        .. "c  foo           foobar", execute('abbrev'))
+   abbrev foo foobar
+   iabbrev fooi foobari
+
+   cabclear
+   call assert_equal("\n\n"
+         \        .. "i  fooi          foobari\n"
+         \        .. "i  foo           foobar", execute('abbrev'))
+   abbrev foo foobar
+   cabbrev fooc foobarc
+
+   abclear
+   call assert_equal("\n\nNo abbreviation found", execute('abbrev'))
+endfunc
+
+func Test_abclear_buffer()
+  abbrev foo foobar
+  new X1
+  abbrev <buffer> foo1 foobar1
+  new X2
+  abbrev <buffer> foo2 foobar2
+
+  call assert_equal("\n\n"
+        \        .. "!  foo2         @foobar2\n"
+        \        .. "!  foo           foobar", execute('abbrev'))
+
+  abclear <buffer>
+  call assert_equal("\n\n"
+        \        .. "!  foo           foobar", execute('abbrev'))
+
+  b X1
+  call assert_equal("\n\n"
+        \        .. "!  foo1         @foobar1\n"
+        \        .. "!  foo           foobar", execute('abbrev'))
+  abclear <buffer>
+  call assert_equal("\n\n"
+        \        .. "!  foo           foobar", execute('abbrev'))
+
+  abclear
+   call assert_equal("\n\nNo abbreviation found", execute('abbrev'))
+
+  %bwipe
+endfunc
+
 func Test_map_ctrl_c_insert()
   " mapping of ctrl-c in Insert mode
   set cpo-=< cpo-=k
index 48e8d99e8910ca2e1fb451e8e80c62c6f80334e2..d3635b06bba6c8f5f6e5980110dc69c6909c9352 100644 (file)
@@ -771,6 +771,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1199,
 /**/
     1198,
 /**/