changeset 17586:ea5d6716b82e v8.1.1790

patch 8.1.1790: :mkvimrc is not tested commit https://github.com/vim/vim/commit/8750026a7f6b445c43adc990141a3fe92d680b62 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Aug 1 23:05:49 2019 +0200 patch 8.1.1790: :mkvimrc is not tested Problem: :mkvimrc is not tested. Solution: Add a test.
author Bram Moolenaar <Bram@vim.org>
date Thu, 01 Aug 2019 23:15:04 +0200
parents 31b9488e5eb3
children f4d6636bc399
files src/testdir/test_mksession.vim src/version.c
diffstat 2 files changed, 44 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_mksession.vim
+++ b/src/testdir/test_mksession.vim
@@ -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
--- a/src/version.c
+++ b/src/version.c
@@ -774,6 +774,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1790,
+/**/
     1789,
 /**/
     1788,