Ai
12 Star 47 Fork 0

Gitee 极速下载/Vim

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/vim/vim
克隆/下载
test_plugin_tutor.vim 1.41 KB
一键复制 编辑 原始数据 按行查看 历史
" Test for the new-tutor plugin
source util/screendump.vim
source util/script_util.vim
func SetUp()
set nocompatible
runtime plugin/tutor.vim
endfunc
func Test_auto_enable_interactive()
Tutor
call assert_equal('nowrite', &buftype)
call assert_match('tutor#EnableInteractive', b:undo_ftplugin)
edit Xtutor/Xtest.tutor
call assert_true(empty(&buftype))
call assert_match('tutor#EnableInteractive', b:undo_ftplugin)
endfunc
func Test_tutor_link()
let tutor_files = globpath($VIMRUNTIME, 'tutor/**/*.tutor', 0, 1)
let pattern = '\[.\{-}@tutor:\zs[^)\]]*\ze[)\]]'
for tutor_file in tutor_files
let lang = fnamemodify(tutor_file, ':h:t')
if lang == 'tutor'
let lang = 'en'
endif
let text = readfile(tutor_file)
let links = matchstrlist(text, pattern)->map({_, v -> v.text})
for link in links
call assert_true(tutor#GlobTutorials(link, lang)->len() > 0)
endfor
endfor
endfunc
func Test_mark()
CheckScreendump
call writefile([
\ 'set nocompatible',
\ 'runtime plugin/tutor.vim',
\ 'Tutor tutor',
\ 'set statusline=',
\ ], 'Xtest_plugin_tutor_mark', 'D')
let buf = RunVimInTerminal('-S Xtest_plugin_tutor_mark', {'rows': 20, 'cols': 78})
call term_sendkeys(buf, ":240\<CR>")
call WaitForAssert({-> assert_match('Bot$', term_getline(buf, 20))})
call VerifyScreenDump(buf, 'Test_plugin_tutor_mark_1', {})
" clean up
call StopVimInTerminal(buf)
endfunc
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/mirrors/vim.git
git@gitee.com:mirrors/vim.git
mirrors
vim
Vim
master

搜索帮助