1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 22:40:04 +08:00
SpaceVim/bundle/neomake/tests/ft_haskell.vader

40 lines
999 B
Plaintext
Raw Normal View History

2020-06-13 14:06:35 +08:00
Include: include/setup.vader
Execute (neomake#makers#ft#haskell#HlintEntryProcess):
function! s:F(text)
let entry = {'text': a:text}
call neomake#makers#ft#haskell#HlintEntryProcess(entry)
return entry.text
endfunction
let simple =
\"Use fmap\n
\ Found:\n
\ liftM\n
\ Why not:\n
\ fmap"
let extra_whitespace =
\"Use fmap\n
\ Found:\n
\ liftM\n
\ Why not:\n
\ fmap"
AssertEqual s:F(simple), 'Use fmap | Found: liftM | Why not: fmap'
AssertEqual s:F(extra_whitespace), 'Use fmap | Found: liftM | Why not: fmap'
let multiline_code =
\"Use fromMaybe\n
\ Found:\n
\ case findIndex (not . null) xs of\n
\ Just ix -> ix\n
\ Nothing -> -1\n
\ Why not:\n
\ fromMaybe (-1) (findIndex (not . null) xs)"
AssertEqual s:F(multiline_code),
\ 'Use fromMaybe | ' .
\ 'Found: case findIndex (not . null) xs of Just ix -> ix Nothing -> -1 | ' .
\ 'Why not: fromMaybe (-1) (findIndex (not . null) xs)'