switch to neobundle

This commit is contained in:
Barak Michener 2016-10-27 13:40:04 -07:00
parent 6cef5c101f
commit 5a1c95140f
57 changed files with 9901 additions and 1958 deletions

View file

@ -0,0 +1,117 @@
" Basic commands test.
set verbose=1
let path = expand('~/test-bundle/'.fnamemodify(expand('<sfile>'), ':t:r'))
if isdirectory(path)
let rm_command = neobundle#util#is_windows() ? 'rmdir /S /Q' : 'rm -rf'
call system(printf('%s "%s"', rm_command, path))
endif
call mkdir(path, 'p')
call neobundle#begin(path)
let g:neobundle#types#git#default_protocol = 'https'
" My Bundles here:
"
" Original repositories in github.
NeoBundle 'Shougo/neocomplcache-clang.git'
" Vim-script repositories.
NeoBundle 'rails.vim'
" Username with dashes.
NeoBundle 'vim-scripts/ragtag.vim'
" Original repo.
NeoBundle 'altercation/vim-colors-solarized'
" With extension.
" Comment is allowed.
NeoBundle 'nelstrom/vim-mac-classic-theme.git' " Foo, Bar
" Invalid uri.
NeoBundle 'nonexistinguser/hogehoge.git'
" Full uri.
NeoBundle 'https://github.com/vim-scripts/vim-game-of-life'
NeoBundle 'git@github.com:gmarik/ingretu.git'
" Short uri.
NeoBundle 'gh:gmarik/snipmate.vim.git'
NeoBundle 'github:mattn/gist-vim.git'
" Camel case.
NeoBundle 'vim-scripts/RubySinatra'
" With options.
NeoBundle 'Shougo/vimshell', '3787e5'
" None repos.
NeoBundle 'muttator', {'type' : 'none', 'base' : '~/.vim/bundle'}
" Raw repos.
NeoBundle 'https://raw.github.com/m2ym/rsense/master/etc/rsense.vim',
\ {'script_type' : 'plugin'}
" NeoBundleLocal test.
NeoBundleLocal ~/.vim/bundle/
" Depends repos.
NeoBundle 'Shougo/neocomplcache',
\ {'depends' : [
\ 'Shougo/neocomplcache-snippets-complete.git',
\ ['rstacruz/sparkup', {'rtp': 'vim'}],
\ ]}
NeoBundle 'Shougo/vimfiler',
\ { 'depends' : 'Shougo/unite.vim' }
" Build repos.
NeoBundle 'Shougo/vimproc', {
\ 'build' : {
\ 'windows' : 'echo "Sorry, cannot update vimproc binary file in Windows."',
\ 'cygwin' : 'make -f make_cygwin.mak',
\ 'mac' : 'make -f make_mac.mak',
\ 'unix' : 'make -f make_unix.mak',
\ },
\ }
" Lazy load.
NeoBundleLazy 'c9s/perlomni.vim.git'
NeoBundleSource perlomni.vim
call neobundle#source(['CSApprox'])
NeoBundleLazy 'The-NERD-tree', {'augroup' : 'NERDTree'}
call neobundle#source(['The-NERD-tree'])
NeoBundleLazy 'masudaK/vim-python'
NeoBundleLazy 'klen/python-mode'
NeoBundleLazy 'Rip-Rip/clang_complete', {
\ 'autoload' : {
\ 'filetypes' : ['c', 'cpp'],
\ },
\ }
" script_type support.
NeoBundle 'https://raw.github.com/m2ym/rsense/master/etc/rsense.vim',
\ {'script_type' : 'plugin'}
" Fetch only.
NeoBundleFetch 'Shougo/neobundle.vim'
call neobundle#end()
filetype plugin indent on " required!
" Should not break helptags.
set wildignore+=doc
" Should not break clone.
set wildignore+=.git
set wildignore+=.git/*
set wildignore+=*/.git/*

View file

@ -0,0 +1,35 @@
" Lock file test.
set verbose=1
let path = expand('~/test-bundle/'.fnamemodify(expand('<sfile>'), ':t:r'))
if isdirectory(path)
let rm_command = neobundle#util#is_windows() ? 'rmdir /S /Q' : 'rm -rf'
call system(printf('%s "%s"', rm_command, path))
endif
call mkdir(path, 'p')
call neobundle#begin(path)
NeoBundleFetch 'Shougo/neocomplete.vim'
call neobundle#end()
filetype plugin indent on " Required!
" Create lock file
call writefile([
\ 'NeoBundleLock neocomplete.vim 8200dfd83ba829f77f028ea26e81eebbe95e6a89',
\ ], path . '/NeoBundle.lock')
NeoBundleInstall
let s:suite = themis#suite('lock')
let s:assert = themis#helper('assert')
function! s:suite.revision_check() abort
let bundle = neobundle#get('neocomplete.vim')
call s:assert.equals(neobundle#installer#get_revision_number(bundle),
\ '8200dfd83ba829f77f028ea26e81eebbe95e6a89')
endfunction

View file

@ -0,0 +1,333 @@
let s:suite = themis#suite('parser')
let s:assert = themis#helper('assert')
let g:neobundle#types#git#default_protocol = 'https'
let g:neobundle#types#hg#default_protocol = 'https'
let g:neobundle#enable_name_conversion = 0
function! s:suite.github_git_repos() abort
call s:assert.equals(neobundle#parser#path(
\ 'Shougo/neocomplcache-clang.git'),
\ {'type' : 'git', 'uri' :
\ g:neobundle#types#git#default_protocol .
\ '://github.com/Shougo/neocomplcache-clang.git',
\ 'name' : 'neocomplcache-clang'})
call s:assert.equals(neobundle#parser#path('Shougo/vimshell'),
\ {'type' : 'git', 'uri' :
\ g:neobundle#types#git#default_protocol .
\ '://github.com/Shougo/vimshell.git',
\ 'name' : 'vimshell'})
call s:assert.equals(neobundle#parser#path('rails.vim'),
\ {'type' : 'git', 'uri' :
\ g:neobundle#types#git#default_protocol .
\ '://github.com/vim-scripts/rails.vim.git',
\ 'name' : 'rails.vim'})
call s:assert.equals(neobundle#parser#path('vim-scripts/ragtag.vim'),
\ {'type' : 'git', 'uri' :
\ g:neobundle#types#git#default_protocol .
\ '://github.com/vim-scripts/ragtag.vim.git',
\ 'name' : 'ragtag.vim'})
call s:assert.equals(neobundle#parser#path(
\ 'https://github.com/vim-scripts/vim-game-of-life'),
\ {'type' : 'git', 'uri' :
\ 'https://github.com/vim-scripts/vim-game-of-life.git',
\ 'name' : 'vim-game-of-life'})
call s:assert.equals(neobundle#parser#path(
\ 'git@github.com:gmarik/ingretu.git'),
\ {'type' : 'git', 'uri' :
\ 'git@github.com:gmarik/ingretu.git',
\ 'name' : 'ingretu'})
call s:assert.equals(neobundle#parser#path(
\ 'gh:gmarik/snipmate.vim.git'),
\ {'type' : 'git', 'uri' :
\ g:neobundle#types#git#default_protocol .
\ '://github.com/gmarik/snipmate.vim.git',
\ 'name' : 'snipmate.vim'})
call s:assert.equals(neobundle#parser#path(
\ 'github:mattn/gist-vim.git'),
\ {'type' : 'git', 'uri' :
\ g:neobundle#types#git#default_protocol .
\ '://github.com/mattn/gist-vim.git',
\ 'name' : 'gist-vim'})
call s:assert.equals(neobundle#parser#path(
\ 'git@github.com:Shougo/neocomplcache.git'),
\ {'type' : 'git', 'uri' :
\ 'git@github.com:Shougo/neocomplcache.git',
\ 'name' : 'neocomplcache'})
call s:assert.equals(neobundle#parser#path(
\ 'https://github.com/Shougo/neocomplcache/'),
\ {'type' : 'git', 'uri' :
\ 'https://github.com/Shougo/neocomplcache.git',
\ 'name' : 'neocomplcache'})
call s:assert.equals(neobundle#parser#path(
\ 'git://git.wincent.com/command-t.git'),
\ {})
call s:assert.equals(neobundle#parser#path(
\ 'http://github.com/Shougo/neocomplcache/'),
\ {})
endfunction
function! s:suite.svn_repos() abort
call s:assert.equals(neobundle#parser#path(
\ 'http://svn.macports.org/repository/macports/contrib/mpvim/'),
\ {})
call s:assert.equals(neobundle#parser#path(
\ 'svn://user@host/repos/bar'),
\ {})
call s:assert.equals(neobundle#parser#path(
\ 'https://svn.macports.org/repository/macports/contrib/mpvim/'),
\ {'type' : 'svn', 'uri' :
\ 'https://svn.macports.org/repository/macports/contrib/mpvim',
\ 'name' : 'mpvim'})
call s:assert.equals(neobundle#parser#path(
\ 'svn+ssh://user@host/repos/bar'),
\ {'type' : 'svn', 'uri' :
\ 'svn+ssh://user@host/repos/bar',
\ 'name' : 'bar'})
endfunction
function! s:suite.hg_repos() abort
call s:assert.equals(neobundle#parser#path(
\ 'https://bitbucket.org/ns9tks/vim-fuzzyfinder'),
\ {'type' : 'hg', 'uri' :
\ 'https://bitbucket.org/ns9tks/vim-fuzzyfinder',
\ 'name' : 'vim-fuzzyfinder'})
call s:assert.equals(neobundle#parser#path(
\ 'bitbucket://bitbucket.org/ns9tks/vim-fuzzyfinder'),
\ {'type' : 'hg', 'uri' :
\ g:neobundle#types#hg#default_protocol.
\ '://bitbucket.org/ns9tks/vim-fuzzyfinder',
\ 'name' : 'vim-fuzzyfinder'})
call s:assert.equals(neobundle#parser#path(
\ 'bitbucket:ns9tks/vim-fuzzyfinder'),
\ {'type' : 'hg', 'uri' :
\ g:neobundle#types#hg#default_protocol.
\ '://bitbucket.org/ns9tks/vim-fuzzyfinder',
\ 'name' : 'vim-fuzzyfinder'})
call s:assert.equals(neobundle#parser#path(
\ 'ns9tks/vim-fuzzyfinder', {'site': 'bitbucket'}),
\ {'type' : 'hg', 'uri' :
\ g:neobundle#types#hg#default_protocol.
\ '://bitbucket.org/ns9tks/vim-fuzzyfinder',
\ 'name' : 'vim-fuzzyfinder'})
call s:assert.equals(neobundle#parser#path(
\ 'ssh://hg@bitbucket.org/ns9tks/vim-fuzzyfinder'),
\ {'type' : 'hg', 'uri' :
\ 'ssh://hg@bitbucket.org/ns9tks/vim-fuzzyfinder',
\ 'name' : 'vim-fuzzyfinder'})
let bundle = neobundle#parser#_init_bundle(
\ 'https://github.com/Shougo/neobundle.vim.git',
\ [{ 'type' : 'hg'}])
call s:assert.equals(bundle.name, 'neobundle.vim')
call s:assert.equals(bundle.type, 'hg')
call s:assert.equals(bundle.uri,
\ 'https://github.com/Shougo/neobundle.vim.git')
endfunction
function! s:suite.gitbucket_git_repos() abort
call s:assert.equals(neobundle#parser#path(
\ 'https://bitbucket.org/kh3phr3n/vim-qt-syntax.git'),
\ {'type' : 'git', 'uri' :
\ 'https://bitbucket.org/kh3phr3n/vim-qt-syntax.git',
\ 'name' : 'vim-qt-syntax'})
call s:assert.equals(neobundle#parser#path(
\ 'bitbucket:kh3phr3n/vim-qt-syntax.git'),
\ {'type' : 'git', 'uri' :
\ g:neobundle#types#git#default_protocol.
\ '://bitbucket.org/kh3phr3n/vim-qt-syntax.git',
\ 'name' : 'vim-qt-syntax'})
call s:assert.equals(neobundle#parser#path(
\ 'git@bitbucket.com:accountname/reponame.git'),
\ {'type' : 'git', 'uri' :
\ 'git@bitbucket.com:accountname/reponame.git',
\ 'name' : 'reponame'})
call s:assert.equals(neobundle#parser#path(
\ 'ssh://git@bitbucket.com:foo/bar.git'),
\ {'type' : 'git', 'uri' :
\ 'ssh://git@bitbucket.com:foo/bar.git',
\ 'name' : 'bar'})
endfunction
function! s:suite.raw_repos() abort
call s:assert.equals(neobundle#parser#path(
\ 'http://raw.github.com/m2ym/rsense/master/etc/rsense.vim'),
\ {})
call s:assert.equals(neobundle#parser#path(
\ 'http://www.vim.org/scripts/download_script.php?src_id=19237'),
\ {})
let bundle = neobundle#parser#_init_bundle(
\ 'https://raw.github.com/m2ym/rsense/master/etc/rsense.vim',
\ [{ 'script_type' : 'plugin'}])
call s:assert.equals(bundle.name, 'rsense.vim')
call s:assert.equals(bundle.type, 'raw')
call s:assert.equals(bundle.uri,
\ 'https://raw.github.com/m2ym/rsense/master/etc/rsense.vim')
endfunction
function! s:suite.vba_repos() abort
call s:assert.equals(neobundle#parser#path(
\ 'https://foo/bar.vba'),
\ { 'name' : 'bar', 'uri' : 'https://foo/bar.vba', 'type' : 'vba' })
call s:assert.equals(neobundle#parser#path(
\ 'https://foo/bar.vba.gz'),
\ { 'name' : 'bar', 'uri' : 'https://foo/bar.vba.gz', 'type' : 'vba' })
call s:assert.equals(neobundle#parser#path(
\ 'http://foo/bar.vba.gz'),
\ {})
endfunction
function! s:suite.default_options() abort
let g:default_options_save = g:neobundle#default_options
let g:neobundle#default_options =
\ { 'rev' : {'type__update_style' : 'current'},
\ '_' : {'type' : 'hg'} }
let bundle = neobundle#parser#_init_bundle(
\ 'Shougo/neocomplcache', ['', 'rev', {}])
call s:assert.equals(bundle.type__update_style, 'current')
let bundle2 = neobundle#parser#_init_bundle(
\ 'Shougo/neocomplcache', [])
call s:assert.equals(bundle2.type, 'hg')
let g:neobundle#default_options = g:default_options_save
endfunction
function! s:suite.ssh_protocol() abort
let bundle = neobundle#parser#_init_bundle(
\ 'accountname/reponame', [{
\ 'site' : 'github', 'type' : 'git', 'type__protocol' : 'ssh' }])
call s:assert.equals(bundle.uri,
\ 'git@github.com:accountname/reponame.git')
let bundle = neobundle#parser#_init_bundle(
\ 'accountname/reponame', [{
\ 'site' : 'bitbucket', 'type' : 'hg', 'type__protocol' : 'ssh' }])
call s:assert.equals(bundle.uri,
\ 'ssh://hg@bitbucket.org/accountname/reponame')
let bundle = neobundle#parser#_init_bundle(
\ 'accountname/reponame.git', [{
\ 'site' : 'bitbucket', 'type' : 'git', 'type__protocol' : 'ssh' }])
call s:assert.equals(bundle.uri,
\ 'git@bitbucket.org:accountname/reponame.git')
endfunction
function! s:suite.fetch_plugins() abort
let bundle = neobundle#parser#fetch(
\ string('accountname/reponame.git'))
call s:assert.equals(bundle.rtp, '')
endfunction
function! s:suite.parse_directory() abort
let bundle = neobundle#parser#_init_bundle(
\ 'Shougo/neocomplcache', [])
call s:assert.equals(bundle.directory, 'neocomplcache')
let bundle = neobundle#parser#_init_bundle(
\ 'Shougo/neocomplcache', ['ver.3'])
call s:assert.equals(bundle.directory, 'neocomplcache_ver_3')
endfunction
function! s:suite.name_conversion() abort
let g:neobundle#enable_name_conversion = 1
let bundle = neobundle#parser#_init_bundle(
\ 'https://github.com/Shougo/neobundle.vim.git',
\ [{ 'type' : 'hg'}])
call s:assert.equals(bundle.name, 'neobundle')
let bundle = neobundle#parser#_init_bundle(
\ 'https://bitbucket.org/kh3phr3n/vim-qt-syntax.git',
\ [{ 'type' : 'hg'}])
call s:assert.equals(bundle.name, 'qt-syntax')
let bundle = neobundle#parser#_init_bundle(
\ 'https://bitbucket.org/kh3phr3n/qt-syntax-vim.git',
\ [{ 'type' : 'hg'}])
call s:assert.equals(bundle.name, 'qt-syntax')
let bundle = neobundle#parser#_init_bundle(
\ 'https://bitbucket.org/kh3phr3n/vim-qt-syntax.git',
\ [{ 'name' : 'vim-qt-syntax'}])
call s:assert.equals(bundle.name, 'vim-qt-syntax')
let g:neobundle#enable_name_conversion = 0
endfunction
function! s:suite.autoload() abort
let bundle = neobundle#parser#_init_bundle(
\ 'https://github.com/Shougo/neobundle.vim.git',
\ [{ 'filetypes' : 'foo_ft' }])
call s:assert.equals(bundle.on_ft, ['foo_ft'])
call s:assert.equals(bundle.lazy, 1)
let bundle = neobundle#parser#_init_bundle(
\ 'https://github.com/Shougo/neobundle.vim.git',
\ [{ 'filename_patterns' : 'foo_filename' }])
call s:assert.equals(bundle.on_path, ['foo_filename'])
call s:assert.equals(bundle.lazy, 1)
let bundle = neobundle#parser#_init_bundle(
\ 'https://github.com/Shougo/neobundle.vim.git',
\ [{ 'explorer' : 1 }])
call s:assert.equals(bundle.on_path, ['.*'])
call s:assert.equals(bundle.lazy, 1)
let bundle = neobundle#parser#_init_bundle(
\ 'https://github.com/Shougo/neobundle.vim.git',
\ [{ 'commands' : 'Foo' }])
call s:assert.equals(bundle.on_cmd, ['Foo'])
call s:assert.equals(bundle.lazy, 1)
let bundle = neobundle#parser#_init_bundle(
\ 'https://github.com/Shougo/neobundle.vim.git',
\ [{ 'functions' : 'foo#bar' }])
call s:assert.equals(bundle.on_func, ['foo#bar'])
call s:assert.equals(bundle.lazy, 1)
let bundle = neobundle#parser#_init_bundle(
\ 'https://github.com/Shougo/neobundle.vim.git',
\ [{ 'mappings' : '<Plug>' }])
call s:assert.equals(bundle.on_map, ['<Plug>'])
call s:assert.equals(bundle.lazy, 1)
let bundle = neobundle#parser#_init_bundle(
\ 'https://github.com/Shougo/neobundle.vim.git',
\ [{ 'insert' : 1 }])
call s:assert.equals(bundle.on_i, 1)
call s:assert.equals(bundle.lazy, 1)
let bundle = neobundle#parser#_init_bundle(
\ 'https://github.com/Shougo/neobundle.vim.git',
\ [{ 'on_source' : 'plug_foo' }])
call s:assert.equals(bundle.on_source, ['plug_foo'])
call s:assert.equals(bundle.lazy, 1)
let bundle = neobundle#parser#_init_bundle(
\ 'https://github.com/Shougo/neobundle.vim.git',
\ [{ 'command_prefix' : 'PreFoo' }])
call s:assert.equals(bundle.pre_cmd, ['PreFoo'])
call s:assert.equals(bundle.lazy, 0)
let bundle = neobundle#parser#_init_bundle(
\ 'https://github.com/Shougo/neobundle.vim.git',
\ [{ 'function_prefixes' : 'foo#' }])
call s:assert.equals(bundle.pre_func, ['foo#'])
call s:assert.equals(bundle.lazy, 0)
endfunction
function! s:suite.deprecated() abort
let bundle = neobundle#parser#_init_bundle(
\ 'https://github.com/Shougo/neobundle.vim.git',
\ [{ 'stay_same' : '1' }])
call s:assert.equals(bundle.frozen, 1)
let bundle = neobundle#parser#_init_bundle(
\ 'https://github.com/Shougo/neobundle.vim.git',
\ [{ 'type' : 'nosync' }])
call s:assert.equals(bundle.type, 'none')
endfunction
" vim:foldmethod=marker:fen:

View file

@ -0,0 +1,39 @@
" Sample configurations test.
set verbose=1
let path = expand('~/test-bundle/'.fnamemodify(expand('<sfile>'), ':t:r'))
if isdirectory(path)
let rm_command = neobundle#util#is_windows() ? 'rmdir /S /Q' : 'rm -rf'
call system(printf('%s "%s"', rm_command, path))
endif
let neobundle#types#git#default_protocol = 'git'
call neobundle#begin(path)
" Let NeoBundle manage NeoBundle
NeoBundleFetch 'Shougo/neobundle.vim'
" Recommended to install
" After install, turn shell ~/.vim/bundle/vimproc, (n,g)make -f your_machines_makefile
NeoBundle 'Shougo/vimproc'
" My Bundles here:
"
" Note: You don't set neobundle setting in .gvimrc!
" Original repos on github
NeoBundle 'tpope/vim-fugitive'
NeoBundle 'Lokaltog/vim-easymotion'
NeoBundle 'rstacruz/sparkup', {'rtp': 'vim/'}
" vim-scripts repos
NeoBundle 'L9'
NeoBundle 'FuzzyFinder'
NeoBundle 'rails.vim'
" Non git repos
NeoBundle 'https://bitbucket.org/ns9tks/vim-fuzzyfinder'
call neobundle#end()
filetype plugin indent on " Required!

View file

@ -0,0 +1,95 @@
" Source test.
set verbose=1
let path = expand('~/test-bundle/'.fnamemodify(expand('<sfile>'), ':t:r'))
if isdirectory(path)
let rm_command = neobundle#util#is_windows() ? 'rmdir /S /Q' : 'rm -rf'
call system(printf('%s "%s"', rm_command, path))
endif
let neobundle#types#git#default_protocol = 'https'
call neobundle#begin(path)
" Test dependencies.
let s:suite = themis#suite('source')
let s:assert = themis#helper('assert')
NeoBundleLazy 'Shougo/echodoc'
NeoBundle 'Shougo/unite-build', { 'depends' : 'Shougo/echodoc' }
NeoBundle 'Shougo/unite-ssh', { 'depends' : 'Shougo/unite-sudo' }
NeoBundleLazy 'Shougo/unite-sudo'
NeoBundleLazy 'Shougo/neomru.vim', { 'depends': 'Shougo/neocomplcache' }
NeoBundle 'Shougo/neocomplcache.vim', 'ver.8'
NeoBundleLazy 'Shougo/vimshell', { 'depends': 'Shougo/vinarise' }
NeoBundleLazy 'Shougo/vinarise'
NeoBundle 'Shougo/vimfiler', { 'depends' : 'foo/var' }
NeoBundleLazy 'Shougo/unite.vim', {
\ 'depends' : ['Shougo/unite-outline', 'basyura/TweetVim'],
\ 'autoload' : { 'commands' : 'Unite' } }
NeoBundleLazy 'Shougo/unite-outline', {
\ 'depends' : 'Shougo/unite.vim' }
" Dependencies test.
NeoBundleLazy 'basyura/twibill.vim'
NeoBundleLazy 'yomi322/neco-tweetvim'
NeoBundleLazy 'rhysd/tweetvim-advanced-filter'
NeoBundleLazy 'rhysd/TweetVim', {
\ 'depends' :
\ ['basyura/twibill.vim',
\ 'tyru/open-browser.vim',
\ 'yomi322/neco-tweetvim',
\ 'rhysd/tweetvim-advanced-filter'],
\ 'autoload' : {
\ 'commands' :
\ ['TweetVimHomeTimeline',
\ 'TweetVimMentions',
\ 'TweetVimSay',
\ 'TweetVimUserTimeline']
\ }
\ }
" Law.
NeoBundle 'https://raw.github.com/m2ym/rsense/master/etc/rsense.vim',
\ {'script_type' : 'plugin', 'rev' : '0'}
" NeoBundleReinstall rsense.vim
call neobundle#end()
filetype plugin indent on " required!
" Should not break helptags.
set wildignore+=doc
" Should not break clone.
set wildignore+=.git
set wildignore+=.git/*
set wildignore+=*/.git/*
function! s:suite.pattern_a() abort
call s:assert.equals(neobundle#is_sourced('echodoc'), 1)
call s:assert.equals(neobundle#is_sourced('unite-build'), 1)
endfunction
function! s:suite.pattern_b() abort
call s:assert.equals(neobundle#is_sourced('unite-ssh'), 1)
call s:assert.equals(neobundle#is_sourced('unite-sudo'), 1)
endfunction
function! s:suite.pattern_c() abort
call s:assert.equals(neobundle#is_sourced('neomru.vim'), 0)
call s:assert.equals(neobundle#is_sourced('neocomplcache.vim'), 1)
endfunction
function! s:suite.pattern_d() abort
call s:assert.equals(neobundle#is_sourced('vimshell'), 0)
call s:assert.equals(neobundle#is_sourced('vinarise'), 0)
endfunction

View file

@ -0,0 +1,49 @@
let s:suite = themis#suite('toml')
let s:assert = themis#helper('assert')
let g:path = expand('~/test-bundle/'.fnamemodify(expand('<sfile>'), ':t:r'))
function! s:suite.before_each() abort
let g:temp = tempname()
call neobundle#begin(g:path)
endfunction
function! s:suite.after_each() abort
call neobundle#end()
call delete(g:temp)
endfunction
function! s:suite.no_toml() abort
call writefile([
\ 'foobar'
\ ], g:temp)
call s:assert.equals(neobundle#parser#load_toml(g:temp, {}), 1)
endfunction
function! s:suite.no_plugins() abort
call writefile([], g:temp)
call s:assert.equals(neobundle#parser#load_toml(g:temp, {}), 1)
endfunction
function! s:suite.no_repository() abort
call writefile([
\ "[[plugins]]",
\ "filetypes = 'all'",
\ "[[plugins]]",
\ "filetypes = 'all'"
\ ], g:temp)
call s:assert.equals(neobundle#parser#load_toml(g:temp, {}), 1)
endfunction
function! s:suite.normal() abort
call writefile([
\ "[[plugins]]",
\ "repository = 'Shougo/tabpagebuffer.vim'",
\ "filetypes = 'all'",
\ "[[plugins]]",
\ "repository = 'Shougo/tabpagebuffer.vim'",
\ "filetypes = 'all'"
\ ], g:temp)
call s:assert.equals(neobundle#parser#load_toml(g:temp, {}), 0)
endfunction

View file

@ -0,0 +1,182 @@
let s:suite = themis#suite('tsort')
let s:assert = themis#helper('assert')
let g:path = expand('~/test-bundle/'.fnamemodify(expand('<sfile>'), ':t:r'))
function! s:comp_bundle(bundle1, bundle2) abort
return a:bundle1.name > a:bundle2.name
endfunction
function! s:rotate_bundle(bundles) abort
return a:bundles[1:-1]+a:bundles[0:0]
endfunction
function! s:suite.before_each() abort
endfunction
function! s:suite.after_each() abort
endfunction
function! s:suite.no_depends() abort
" [a, b, c] => [a, b, c]
let neobundle_test_data = [{'name' : 'a'}, {'name' : 'b'}, {'name' : 'c'},]
call s:assert.equals(neobundle#config#tsort(neobundle_test_data),
\ neobundle_test_data)
endfunction
function! s:suite.normal() abort
" a -> b -> c
" b -> d
" c
" [a, b, c] => [c, b, a]
let neobundle_test_data = [
\ {'name' : 'a', 'depends' : [
\ {'name' : 'b', 'depends' : [
\ {'name' : 'c'},
\ ]},
\ ]},
\ {'name' : 'b', 'skip' : 1, 'depends' : [
\ {'name' : 'd', 'skipped' : 1, },
\ ]},
\ {'name' : 'c', 'skip' : 1},
\ ]
call s:assert.equals(neobundle#config#tsort(neobundle_test_data), [
\ neobundle_test_data[0].depends[0].depends[0],
\ neobundle_test_data[0].depends[0],
\ neobundle_test_data[0],
\ ])
" a -> c -> b
" a -> d
" b
" c
" [a, b, c] => [b, c, d, a]
let neobundle_test_data = [
\ {'name' : 'a', 'depends' : [
\ {'name' : 'c', 'depends' : [
\ {'name' : 'b'},
\ ]},
\ {'name' : 'd'},
\ ]},
\ {'name' : 'b', 'skip' : 1},
\ {'name' : 'c', 'skip' : 1},
\ ]
call s:assert.equals(neobundle#config#tsort(neobundle_test_data),
\ [
\ neobundle_test_data[0].depends[0].depends[0],
\ neobundle_test_data[0].depends[0],
\ neobundle_test_data[0].depends[1],
\ neobundle_test_data[0],
\ ])
endfunction
function! s:suite.tsort_circular_reference() abort
" a -> b -> c -> a
" b
" c
" [a, b, c] => [c, b, a]
let neobundle_test_data = [
\ {'name' : 'a', 'depends' : [
\ {'name' : 'b', 'depends' : [
\ {'name' : 'c', 'depends' : [
\ {'name' : 'a', 'skip' : 1},
\ ]},
\ ]},
\ ]},
\ {'name' : 'b', 'skip' : 1},
\ {'name' : 'c', 'skip' : 1},
\ ]
call s:assert.equals(neobundle#config#tsort(neobundle_test_data),
\ [
\ neobundle_test_data[0].depends[0].depends[0],
\ neobundle_test_data[0].depends[0],
\ neobundle_test_data[0],
\ ])
endfunction
function! s:suite.bundled_no_depends() abort
call neobundle#begin(g:path)
NeoBundleLazy 'a/a'
NeoBundleLazy 'b/b'
NeoBundleLazy 'c/c'
call neobundle#end()
let neobundle_test_data = sort(filter(neobundle#config#get_neobundles(),
\ "v:val.name =~# '^[abc]$'"), "s:comp_bundle")
" [a, b, c] => [a, b, c]
call s:assert.equals(s:map(neobundle#config#tsort(neobundle_test_data)),
\ s:map(neobundle_test_data))
" [c, b, a] => [c, b, a]
call reverse(neobundle_test_data)
call s:assert.equals(s:map(neobundle#config#tsort(neobundle_test_data)),
\ s:map(neobundle_test_data))
endfunction
function! s:suite.bundled_normal() abort
call neobundle#begin(g:path)
NeoBundleLazy 'a/a'
NeoBundleLazy 'b/b', {'depends' : 'a/a'}
NeoBundleLazy 'c/c', {'depends' : 'b/b'}
call neobundle#end()
let neobundle_test_data = sort(filter(neobundle#config#get_neobundles(),
\ "v:val.name =~# '^[abc]$'"), "s:comp_bundle")
" [a, b, c] => [a, b, c]
call s:assert.equals(s:map(neobundle#config#tsort(neobundle_test_data)),
\ s:map(neobundle_test_data))
" [c, b, a] => [a, b, c]
call s:assert.equals(s:map(neobundle#config#tsort(
\ reverse(copy(neobundle_test_data)))), s:map(neobundle_test_data))
endfunction
function! s:suite.bundled_normal2() abort
call neobundle#begin(g:path)
NeoBundleLazy 'a/a', {'depends' : ['c/c', 'b/b']}
NeoBundleLazy 'b/b'
NeoBundleLazy 'c/c', {'depends' : 'b/b'}
call neobundle#end()
let neobundle_test_data = sort(filter(neobundle#config#get_neobundles(),
\ "v:val.name =~# '^[abc]$'"), "s:comp_bundle")
let neobundle_test_rotated = s:map(s:rotate_bundle(neobundle_test_data))
" [a, b, c] => [b, c, a]
call s:assert.equals(s:map(neobundle#config#tsort(
\ neobundle_test_data)),
\ neobundle_test_rotated)
" [c, b, a] => [b, c, a]
call s:assert.equals(s:map(neobundle#config#tsort(
\ reverse(copy(neobundle_test_data)))),
\ neobundle_test_rotated)
endfunction
function! s:suite.bundled_circular_reference() abort
call neobundle#begin(g:path)
NeoBundleLazy 'a/a', {'depends' : 'b/b'}
NeoBundleLazy 'b/b', {'depends' : 'c/c'}
NeoBundleLazy 'c/c', {'depends' : 'a/a'}
call neobundle#end()
let neobundle_test_data = sort(filter(neobundle#config#get_neobundles(),
\ "v:val.name =~# '^[abc]$'"), "s:comp_bundle")
" [a, b, c] => [c, b, a]
call s:assert.equals(s:map(neobundle#config#tsort(neobundle_test_data)),
\ s:map(reverse(copy(neobundle_test_data))))
" [c, b, a] => [b, a, c]
call reverse(neobundle_test_data)
let neobundle_test_rotated = s:rotate_bundle(neobundle_test_data)
call s:assert.equals(s:map(neobundle#config#tsort(neobundle_test_data)),
\ s:map(neobundle_test_rotated))
endfunction
function! s:map(list) abort
return map(copy(a:list), 'v:val.name')
endfunction