Mercurial > vim
view src/testdir/test_packadd.vim @ 8495:8877ea0a27ec v7.4.1538
commit https://github.com/vim/vim/commit/4fc563b397949ce23190045112fa08c0776a56e6
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 12 12:40:58 2016 +0100
patch 7.4.1538
Problem: Selection with the mouse does not work in command line mode.
Solution: Use cairo functions. (Kazunobu Kuriyama)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 12 Mar 2016 12:45:04 +0100 |
parents | 1a6527cce675 |
children | b4350a4d1e01 |
line wrap: on
line source
" Tests for 'packpath' and :packadd func SetUp() let s:topdir = expand('%:h') . '/Xdir' exe 'set packpath=' . s:topdir let s:plugdir = s:topdir . '/pack/mine/opt/mytest' endfunc func TearDown() call delete(s:topdir, 'rf') endfunc func Test_packadd() call mkdir(s:plugdir . '/plugin', 'p') call mkdir(s:plugdir . '/ftdetect', 'p') set rtp& let rtp = &rtp filetype on exe 'split ' . s:plugdir . '/plugin/test.vim' call setline(1, 'let g:plugin_works = 42') wq exe 'split ' . s:plugdir . '/ftdetect/test.vim' call setline(1, 'let g:ftdetect_works = 17') wq packadd mytest call assert_equal(42, g:plugin_works) call assert_equal(17, g:ftdetect_works) call assert_true(len(&rtp) > len(rtp)) call assert_true(&rtp =~ 'testdir/Xdir/pack/mine/opt/mytest\($\|,\)') " Check exception call assert_fails("packadd directorynotfound", 'E919:') call assert_fails("packadd", 'E471:') endfunc func Test_packadd_noload() call mkdir(s:plugdir . '/plugin', 'p') call mkdir(s:plugdir . '/syntax', 'p') set rtp& let rtp = &rtp exe 'split ' . s:plugdir . '/plugin/test.vim' call setline(1, 'let g:plugin_works = 42') wq let g:plugin_works = 0 packadd! mytest call assert_true(len(&rtp) > len(rtp)) call assert_true(&rtp =~ 'testdir/Xdir/pack/mine/opt/mytest\($\|,\)') call assert_equal(0, g:plugin_works) " check the path is not added twice let new_rtp = &rtp packadd! mytest call assert_equal(new_rtp, &rtp) endfunc " Check command-line completion for 'packadd' func Test_packadd_completion() let optdir1 = &packpath . '/pack/mine/opt' let optdir2 = &packpath . '/pack/candidate/opt' call mkdir(optdir1 . '/pluginA', 'p') call mkdir(optdir1 . '/pluginC', 'p') call mkdir(optdir2 . '/pluginB', 'p') call mkdir(optdir2 . '/pluginC', 'p') let li = [] call feedkeys(":packadd \<Tab>')\<C-B>call add(li, '\<CR>", 't') call feedkeys(":packadd " . repeat("\<Tab>", 2) . "')\<C-B>call add(li, '\<CR>", 't') call feedkeys(":packadd " . repeat("\<Tab>", 3) . "')\<C-B>call add(li, '\<CR>", 't') call feedkeys(":packadd " . repeat("\<Tab>", 4) . "')\<C-B>call add(li, '\<CR>", 'tx') call assert_equal("packadd pluginA", li[0]) call assert_equal("packadd pluginB", li[1]) call assert_equal("packadd pluginC", li[2]) call assert_equal("packadd ", li[3]) endfunc