Exercism-এ আপনার Vim script অনুশীলনীগুলো কীভাবে টেস্ট করবেন তা শিখুন
টেস্ট স্যুট চালানো এবং সেরা অনুশীলন নিশ্চিত করার জন্য এই ট্র্যাকটি দুটি টুল ব্যবহার করে:
$ vim exercise.vim
:source %
:Vader exercise.vader
পাথ ভিন্ন হতে পারে।
উপরের ধাপগুলোর জন্য একটি সুবিধাজনক শর্টকাট চাইলে এটি আপনার vimrc-তে রাখুন:
function! s:exercism_tests()
if expand('%:e') == 'vim'
let testfile = printf('%s/%s.vader', expand('%:p:h'),
\ tr(expand('%:p:h:t'), '-', '_'))
if !filereadable(testfile)
echoerr 'File does not exist: '. testfile
return
endif
source %
execute 'Vader' testfile
else
let sourcefile = printf('%s/%s.vim', expand('%:p:h'),
\ tr(expand('%:p:h:t'), '-', '_'))
if !filereadable(sourcefile)
echoerr 'File does not exist: '. sourcefile
return
endif
execute 'source' sourcefile
Vader
endif
endfunction
autocmd BufRead *.{vader,vim}
\ command! -buffer Test call s:exercism_tests()
এরপর অনুশীলনীর ডিরেক্টরি থেকে যেকোনো .vim বা .vader ফাইল খুলে :Test কমান্ডটি চালান।
$ vint .
Vim script ট্র্যাক সম্পর্কে আরও বিস্তারিত তথ্যের জন্য সহায়তা পৃষ্ঠা দেখুন।