Guest User

Untitled

a guest
Feb 19th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. if exists("g:perl_test_class_test")
  2. finish
  3. endif
  4. let g:perl_test_class_test = 1
  5.  
  6.  
  7. function! s:PerlTestClassMethodRun()
  8. let re = '\vsub\s+(\w+)\s*:\s*Test'
  9. let line = search(re, 'bn')
  10. if line
  11. let res = matchlist(getline(line), re)
  12. execute '!TEST_METHOD="' . res[1] . '" /usr/bin/env perl -MP -w %'
  13. endif
  14. endfunction
  15.  
  16. nmap ,t :call <SID>PerlTestClassMethodRun()<CR>
Add Comment
Please, Sign In to add comment