Skip to content

Instantly share code, notes, and snippets.

@hotchpotch
Created August 4, 2008 03:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hotchpotch/3854 to your computer and use it in GitHub Desktop.
Save hotchpotch/3854 to your computer and use it in GitHub Desktop.
if exists("g:perl_test_class_test")
finish
endif
let g:perl_test_class_test = 1
function! s:PerlTestClassMethodRun()
let re = '\vsub\s+(\w+)\s*:\s*Test'
let line = search(re, 'bn')
if line
let res = matchlist(getline(line), re)
execute '!TEST_METHOD="' . res[1] . '" /usr/bin/env perl -MP -w %'
endif
endfunction
nmap ,t :call <SID>PerlTestClassMethodRun()<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment