summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.1199
blob: 8679f825f7eefebc5ed91c37b7561f891677c1a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
To: vim_dev@googlegroups.com
Subject: Patch 8.1.1199
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.1199
Problem:    No test for :abclear.
Solution:   Add a test. (Dominique Pelle, closes #4292)
Files:	    src/testdir/test_mapping.vim


*** ../vim-8.1.1198/src/testdir/test_mapping.vim	2019-03-26 22:46:01.885928372 +0100
--- src/testdir/test_mapping.vim	2019-04-23 16:33:42.161016524 +0200
***************
*** 11,16 ****
--- 11,72 ----
    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
*** ../vim-8.1.1198/src/version.c	2019-04-21 17:22:29.749014298 +0200
--- src/version.c	2019-04-23 16:35:21.476465071 +0200
***************
*** 773,774 ****
--- 773,776 ----
  {   /* Add new patch number below this line */
+ /**/
+     1199,
  /**/

-- 
Not too long ago, a program was something you watched on TV...

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///