]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.1.1790: :mkvimrc is not tested v8.1.1790
authorBram Moolenaar <Bram@vim.org>
Thu, 1 Aug 2019 21:05:49 +0000 (23:05 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 1 Aug 2019 21:05:49 +0000 (23:05 +0200)
Problem:    :mkvimrc is not tested.
Solution:   Add a test.

src/testdir/test_mksession.vim
src/version.c

index 078b8a04fcee0296dad274ba8b4512d906137a57..62f14547bab46b9b8a7fcffd24d1423af1728273 100644 (file)
@@ -536,5 +536,47 @@ func Test_mksession_quote_in_filename()
   call delete('Xtest_mks_quoted.out')
 endfunc
 
+func s:ClearMappings()
+  mapclear
+  omapclear
+  mapclear!
+  lmapclear
+  tmapclear
+endfunc
+
+func Test_mkvimrc()
+  let entries = [
+        \ ['', 'nothing', '<Nop>'],
+        \ ['n', 'normal', 'NORMAL'],
+        \ ['v', 'visual', 'VISUAL'],
+        \ ['s', 'select', 'SELECT'],
+        \ ['x', 'visualonly', 'VISUALONLY'],
+        \ ['o', 'operator', 'OPERATOR'],
+        \ ['i', 'insert', 'INSERT'],
+        \ ['l', 'lang', 'LANG'],
+        \ ['c', 'command', 'COMMAND'],
+        \ ['t', 'terminal', 'TERMINAL'],
+        \ ]
+  for entry in entries
+    exe entry[0] .. 'map ' .. entry[1] .. ' ' .. entry[2]
+  endfor
+
+  mkvimrc Xtestvimrc
+
+  call s:ClearMappings()
+  for entry in entries
+    call assert_equal('', maparg(entry[1], entry[0]))
+  endfor
+
+  source Xtestvimrc
+
+  for entry in entries
+    call assert_equal(entry[2], maparg(entry[1], entry[0]))
+  endfor
+
+  call s:ClearMappings()
+  call delete('Xtestvimrc')
+endfunc
+
 
 " vim: shiftwidth=2 sts=2 expandtab
index 723a1c152ef96bd99b35f84917abc9b8d3e033e6..81f59f9441997a311b34a9736fdb2ea3001e3248 100644 (file)
@@ -773,6 +773,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1790,
 /**/
     1789,
 /**/