Skip to content

Commit

Permalink
improve test script: avoid func_ref to script local function
Browse files Browse the repository at this point in the history
  • Loading branch information
itchyny committed Apr 21, 2017
1 parent dff85fc commit 03bc82e
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions test/test.vim
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
let s:assert = themis#helper('assert')

function! s:before()
filetype plugin indent on
setlocal filetype=haskell
setlocal formatoptions-=cro
endfunction

function! s:before_each()
% delete _
setlocal expandtab shiftwidth=2
let g:haskell_indent_disable_case = 0
endfunction

function! s:test(path)
for path in filter(split(glob(a:path . '/*')), 'isdirectory(v:val)')
let suite = themis#suite('Test for ' . matchstr(path, '\w*$'))
let suite.before = function('s:before')
let suite.before_each = function('s:before_each')
function! suite.before() abort
filetype plugin indent on
setlocal filetype=haskell
setlocal formatoptions-=cro
endfunction
function! suite.before_each() abort
% delete _
setlocal expandtab shiftwidth=2
let g:haskell_indent_disable_case = 0
endfunction
for infile in split(glob(path . '/*.in.hs', 1), "\n")
execute join([
\ 'function! suite.' . matchstr(infile, '\w*\ze\.in\.hs$') . '()'
Expand Down

0 comments on commit 03bc82e

Please sign in to comment.