aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-08-02 07:39:55 -0400
committerDaniel Hahler <git@thequod.de>2019-08-26 09:39:00 +0200
commit233597152a49748aff5e4851bd4bcdeabb4a66fd (patch)
treecdbe9faa7889db129f61b17849bfe7fe6445d371
parentb2d6a6891e52254700ee2d81a8651c3e50466d84 (diff)
downloadrneovim-233597152a49748aff5e4851bd4bcdeabb4a66fd.tar.gz
rneovim-233597152a49748aff5e4851bd4bcdeabb4a66fd.tar.bz2
rneovim-233597152a49748aff5e4851bd4bcdeabb4a66fd.zip
vim-patch:8.1.1790: :mkvimrc is not tested
Problem: :mkvimrc is not tested. Solution: Add a test. https://github.com/vim/vim/commit/8750026a7f6b445c43adc990141a3fe92d680b62
-rw-r--r--src/nvim/testdir/test_mksession.vim42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_mksession.vim b/src/nvim/testdir/test_mksession.vim
index 4e6d96ee48..0e56ed2ff3 100644
--- a/src/nvim/testdir/test_mksession.vim
+++ b/src/nvim/testdir/test_mksession.vim
@@ -267,4 +267,46 @@ 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