Mercurial > vim
comparison src/testdir/test_mksession.vim @ 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 | 7927cf327396 |
children | 049a7481d737 |
comparison
equal
deleted
inserted
replaced
17585:31b9488e5eb3 | 17586:ea5d6716b82e |
---|---|
534 | 534 |
535 %bwipe! | 535 %bwipe! |
536 call delete('Xtest_mks_quoted.out') | 536 call delete('Xtest_mks_quoted.out') |
537 endfunc | 537 endfunc |
538 | 538 |
539 func s:ClearMappings() | |
540 mapclear | |
541 omapclear | |
542 mapclear! | |
543 lmapclear | |
544 tmapclear | |
545 endfunc | |
546 | |
547 func Test_mkvimrc() | |
548 let entries = [ | |
549 \ ['', 'nothing', '<Nop>'], | |
550 \ ['n', 'normal', 'NORMAL'], | |
551 \ ['v', 'visual', 'VISUAL'], | |
552 \ ['s', 'select', 'SELECT'], | |
553 \ ['x', 'visualonly', 'VISUALONLY'], | |
554 \ ['o', 'operator', 'OPERATOR'], | |
555 \ ['i', 'insert', 'INSERT'], | |
556 \ ['l', 'lang', 'LANG'], | |
557 \ ['c', 'command', 'COMMAND'], | |
558 \ ['t', 'terminal', 'TERMINAL'], | |
559 \ ] | |
560 for entry in entries | |
561 exe entry[0] .. 'map ' .. entry[1] .. ' ' .. entry[2] | |
562 endfor | |
563 | |
564 mkvimrc Xtestvimrc | |
565 | |
566 call s:ClearMappings() | |
567 for entry in entries | |
568 call assert_equal('', maparg(entry[1], entry[0])) | |
569 endfor | |
570 | |
571 source Xtestvimrc | |
572 | |
573 for entry in entries | |
574 call assert_equal(entry[2], maparg(entry[1], entry[0])) | |
575 endfor | |
576 | |
577 call s:ClearMappings() | |
578 call delete('Xtestvimrc') | |
579 endfunc | |
580 | |
539 | 581 |
540 " vim: shiftwidth=2 sts=2 expandtab | 582 " vim: shiftwidth=2 sts=2 expandtab |