2017-02-14 17:47:53 -05:00
Execute(The ghc handler should handle hdevtools output):
2017-06-25 12:08:57 -04:00
call ale#test#SetFilename('foo.hs')
2017-02-14 17:47:53 -05:00
AssertEqual
\ [
2017-04-24 16:11:27 -04:00
\ {
\ 'lnum': 147,
\ 'type': 'W',
\ 'col': 62,
\ 'text': '• Couldnt match type ‘ a -> T.Text’ with ‘ T.Text’ Expected type: [T.Text]',
2017-11-26 13:24:10 -05:00
\ 'detail': join([
\ '• Couldnt match type ‘ a -> T.Text’ with ‘ T.Text’ ',
\ ' Expected type: [T.Text]',
\ ], "\n"),
2017-04-24 16:11:27 -04:00
\ },
2017-02-14 17:47:53 -05:00
\ ],
2017-06-25 12:08:57 -04:00
\ ale#handlers#haskell#HandleGHCFormat(bufnr(''), [
\ 'foo.hs:147:62: warning:',
2017-02-14 17:47:53 -05:00
\ '• Couldnt match type ‘ a -> T.Text’ with ‘ T.Text’ ',
\ ' Expected type: [T.Text]',
\ ])
2017-02-14 17:47:53 -05:00
Execute(The ghc handler should handle ghc 8 output):
2017-06-25 12:08:57 -04:00
call ale#test#SetFilename('src/Appoint/Lib.hs')
2017-02-14 17:47:53 -05:00
AssertEqual
\ [
2017-04-24 16:11:27 -04:00
\ {
\ 'lnum': 6,
\ 'type': 'E',
\ 'col': 1,
2017-07-06 19:28:22 -04:00
\ 'text': 'Failed to load interface for ‘ GitHub.Data’ Use -v to see a list of the files searched for.',
2017-11-26 13:24:10 -05:00
\ 'detail': join([
\ ' Failed to load interface for ‘ GitHub.Data’ ',
\ ' Use -v to see a list of the files searched for.',
\ ], "\n"),
2017-04-24 16:11:27 -04:00
\ },
\ {
\ 'lnum': 7,
\ 'type': 'W',
\ 'col': 1,
2017-07-06 19:28:22 -04:00
\ 'text': 'Failed to load interface for ‘ GitHub.Endpoints.PullRequests’ Use -v to see a list of the files searched for.',
2017-11-26 13:24:10 -05:00
\ 'detail': join([
\ ' Failed to load interface for ‘ GitHub.Endpoints.PullRequests’ ',
\ ' Use -v to see a list of the files searched for.',
\ ], "\n"),
2017-04-24 16:11:27 -04:00
\ },
2017-02-14 17:47:53 -05:00
\ ],
2017-06-25 12:08:57 -04:00
\ ale#handlers#haskell#HandleGHCFormat(bufnr(''), [
2017-02-14 17:47:53 -05:00
\ '',
2017-12-19 13:23:09 -05:00
\ ale#path#Simplify('src/Appoint/Lib.hs') . ':6:1: error:',
2017-02-14 17:47:53 -05:00
\ ' Failed to load interface for ‘ GitHub.Data’ ',
\ ' Use -v to see a list of the files searched for.',
\ '',
2017-12-19 13:23:09 -05:00
\ ale#path#Simplify('src/Appoint/Lib.hs') . ':7:1: warning:',
2017-02-14 17:47:53 -05:00
\ ' Failed to load interface for ‘ GitHub.Endpoints.PullRequests’ ',
\ ' Use -v to see a list of the files searched for.',
\ ])
2017-02-14 17:47:53 -05:00
Execute(The ghc handler should handle ghc 7 output):
2017-06-25 12:08:57 -04:00
call ale#test#SetFilename('src/Main.hs')
2017-02-14 17:47:53 -05:00
AssertEqual
\ [
2017-04-24 16:11:27 -04:00
\ {
\ 'lnum': 168,
\ 'type': 'E',
\ 'col': 1,
2017-07-06 19:28:22 -04:00
\ 'text': 'parse error (possibly incorrect indentation or mismatched brackets)',
2017-11-26 13:24:10 -05:00
\ 'detail': join([
\ ' parse error (possibly incorrect indentation or mismatched brackets)',
\ ], "\n"),
2017-07-06 19:28:22 -04:00
\ },
\ {
\ 'lnum': 84,
\ 'col': 1,
\ 'type': 'W',
2017-11-26 13:24:10 -05:00
\ 'text': 'Top-level binding with no type signature: myLayout :: Choose Tall (Choose (Mirror Tall) Full) a',
\ 'detail': join([
\ ' Top-level binding with no type signature:',
\ ' myLayout :: Choose Tall (Choose (Mirror Tall) Full) a',
\ ], "\n"),
2017-07-06 19:28:22 -04:00
\ },
\ {
\ 'lnum': 94,
\ 'col': 5,
\ 'type': 'E',
\ 'text': 'Some other error',
2017-11-26 13:24:10 -05:00
\ 'detail': join([
\ ' Some other error',
\ ], "\n"),
2017-04-24 16:11:27 -04:00
\ },
2017-02-14 17:47:53 -05:00
\ ],
2017-06-25 12:08:57 -04:00
\ ale#handlers#haskell#HandleGHCFormat(bufnr(''), [
2017-12-19 13:23:09 -05:00
\ ale#path#Simplify('src/Main.hs') . ':168:1:',
2017-02-14 17:47:53 -05:00
\ ' parse error (possibly incorrect indentation or mismatched brackets)',
2017-12-19 13:23:09 -05:00
\ ale#path#Simplify('src/Main.hs') . ':84:1:Warning:',
2017-11-26 13:24:10 -05:00
\ ' Top-level binding with no type signature:',
\ ' myLayout :: Choose Tall (Choose (Mirror Tall) Full) a',
2017-12-19 13:23:09 -05:00
\ ale#path#Simplify('src/Main.hs') . ':94:5:Error:',
2017-07-06 19:28:22 -04:00
\ ' Some other error',
2017-02-14 17:47:53 -05:00
\ ])
2017-11-13 17:47:19 -05:00
Execute(The ghc handler should handle stack 1.5.1 output):
call ale#test#SetFilename('src/Main.hs')
AssertEqual
\ [
\ {
\ 'lnum': 160,
\ 'col': 14,
\ 'type': 'E',
\ 'text': '• Expecting one fewer arguments to ‘ Exp’ Expected kind ‘ k0 -> *’ , but ‘ Exp’ has kind ‘ *’ • In the type ‘ Exp a’ | 160 | pattern F :: Exp a | ^^^^^',
2017-11-26 13:24:10 -05:00
\ 'detail': join([
\ ' • Expecting one fewer arguments to ‘ Exp’ ',
\ ' Expected kind ‘ k0 -> *’ , but ‘ Exp’ has kind ‘ *’ ',
\ ' • In the type ‘ Exp a’ ',
\ ' |',
\ ' 160 | pattern F :: Exp a',
\ ' | ^^^^^',
\ ], "\n"),
2017-11-13 17:47:19 -05:00
\ },
\ ],
\ ale#handlers#haskell#HandleGHCFormat(bufnr(''), [
2017-12-19 13:23:09 -05:00
\ ' ' . ale#path#Simplify('src/Main.hs') . ':160:14: error:',
2017-11-13 17:47:19 -05:00
\ ' • Expecting one fewer arguments to ‘ Exp’ ',
\ ' Expected kind ‘ k0 -> *’ , but ‘ Exp’ has kind ‘ *’ ',
\ ' • In the type ‘ Exp a’ ',
\ ' |',
\ ' 160 | pattern F :: Exp a',
\ ' | ^^^^^',
\ ])