See on GitHub

vim-selection-test

vim-selection-test.vim - A test of calling a function with selected text