regressions.vader 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. **********************************************************************
  2. Execute (#112 On-demand loading should not suppress messages from ftplugin):
  3. call plug#begin('$PLUG_FIXTURES')
  4. Plug '$PLUG_FIXTURES/ftplugin-msg', { 'for': 'c' }
  5. call plug#end()
  6. redir => out
  7. tabnew a.c
  8. redir END
  9. Assert stridx(out, 'ftplugin') >= 0
  10. * The same applies to plug#load())
  11. redir => out
  12. call plug#load('ftplugin-msg')
  13. redir END
  14. Assert stridx(out, 'ftplugin') >= 0
  15. q
  16. **********************************************************************
  17. Execute (#114 Should not contain empty path in &rtp):
  18. call plug#begin('$TMPDIR/plugged')
  19. call plug#end()
  20. Log &rtp
  21. Assert &rtp !~ ',,', 'Commas'
  22. Assert &rtp !~ '^,', 'Comma prefix'
  23. Assert &rtp !~ ',$', 'Comma suffix'
  24. **********************************************************************
  25. Execute (#130 Proper cleanup of on-demand loading triggers):
  26. augroup PlugLOD
  27. autocmd!
  28. augroup END
  29. " Cleared on command
  30. call plug#begin('$TMPDIR/plugged')
  31. Plug 'junegunn/vim-emoji', { 'on': ['EmojiCommand', 'EmojiCommand2', '<Plug>(EmojiMapping)'] }
  32. call plug#end()
  33. PlugInstall | q
  34. Assert exists(':EmojiCommand'), 'EmojiCommand not defined'
  35. Assert exists(':EmojiCommand2'), 'EmojiCommand2 not defined'
  36. Assert !empty(mapcheck('<Plug>(EmojiMapping)')), '<Plug>(EmojiMapping) not defined'
  37. silent! EmojiCommand
  38. Assert !exists(':EmojiCommand'), 'EmojiCommand defined'
  39. Assert !exists(':EmojiCommand2'), 'EmojiCommand2 defined'
  40. Assert empty(mapcheck('<Plug>(EmojiMapping)')), '<Plug>(EmojiMapping) defined'
  41. " Cleared on FileType
  42. call plug#begin('$TMPDIR/plugged')
  43. Plug 'junegunn/vim-emoji', { 'on': ['EmojiCommandExtra', '<Plug>(EmojiMappingExtra)'], 'for': ['emoji'] }
  44. call plug#end()
  45. Assert exists(':EmojiCommandExtra'), 'EmojiCommandExtra not defined'
  46. Assert !empty(mapcheck('<Plug>(EmojiMappingExtra)')), '<Plug>(EmojiMappingExtra) not defined'
  47. setf emoji
  48. Assert !exists(':EmojiCommandExtra'), 'EmojiCommandExtra defined'
  49. Assert empty(mapcheck('<Plug>(EmojiMappingExtra)')), '<Plug>(EmojiMappingExtra) defined'
  50. **********************************************************************
  51. Execute (#131 Syntax error):
  52. call plug#begin('/no-permission')
  53. Plug 'junegunn/vim-emoji'
  54. call plug#end()
  55. redir => out
  56. silent PlugInstall
  57. redir END
  58. Assert out =~ 'Invalid plug directory: /no-permission'
  59. **********************************************************************
  60. Execute (#139-1 Using new remote branch):
  61. " Make sure to remove the clone
  62. call plug#begin('$TMPDIR/plugged')
  63. call plug#end()
  64. PlugClean!
  65. " Install master branch
  66. call plug#begin('$TMPDIR/plugged')
  67. Plug expand('file:///$TMPDIR/new-branch')
  68. call plug#end()
  69. PlugUpdate
  70. unlet! g:foo g:bar g:baz
  71. call plug#load('new-branch')
  72. Assert exists('g:foo'), 'g:foo should be found'
  73. Assert !exists('g:bar'), 'g:bar should not be found'
  74. Assert !exists('g:baz'), 'g:baz should not be found'
  75. " Create a new branch on origin
  76. call system('cd $TMPDIR/new-branch && git checkout -b new &&'
  77. \. 'echo "let g:bar = 1" > plugin/bar.vim && git add plugin/bar.vim &&'
  78. \. 'git commit -m second')
  79. " We're setting up two plugins so that parallel installer is used
  80. call plug#begin('$TMPDIR/plugged')
  81. Plug 'junegunn/seoul256.vim'
  82. Plug expand('file:///$TMPDIR/new-branch'), 'new'
  83. call plug#end()
  84. PlugUpdate
  85. silent %y
  86. Log @"
  87. Assert @" !~? 'error', 'Should be able to use new remote branch: ' . @"
  88. unlet! g:foo g:bar g:baz
  89. call plug#load('new-branch')
  90. Assert exists('g:foo'), 'g:foo should be found'
  91. Assert exists('g:bar'), 'g:bar should be found'
  92. Assert !exists('g:baz'), 'g:baz should not be found'
  93. call PlugStatusSorted()
  94. Expect:
  95. - new-branch: OK
  96. - seoul256.vim: OK
  97. Finished. 0 error(s).
  98. [==]
  99. Execute (#139-2 Using yet another new remote branch):
  100. " Create another branch on origin
  101. call system('cd $TMPDIR/new-branch && git checkout master &&'
  102. \. 'git checkout -b brand-new &&'
  103. \. 'echo "let g:baz = 1" > plugin/baz.vim && git add plugin/baz.vim &&'
  104. \. 'git commit -m thirf')
  105. " Test Vim installer here
  106. call plug#begin('$TMPDIR/plugged')
  107. Plug expand('file:///$TMPDIR/new-branch'), 'brand-new'
  108. call plug#end()
  109. PlugUpdate
  110. silent %y
  111. Log @"
  112. Assert @" !~? 'error', 'Should be able to use new remote branch: ' . @"
  113. unlet! g:foo g:bar g:baz
  114. call plug#load('new-branch')
  115. Assert exists('g:foo'), 'g:foo should be found'
  116. Assert !exists('g:bar'), 'g:bar should not be found'
  117. Assert exists('g:baz'), 'g:baz should be found'
  118. call PlugStatusSorted()
  119. Expect:
  120. - new-branch: OK
  121. Finished. 0 error(s).
  122. [=]