summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorlykmast <lykmast@gmail.com>2022-04-06 10:59:50 +0300
committerGitHub <noreply@github.com>2022-04-06 16:59:50 +0900
commit1e997580fdbb8e11e043af071c97d3aa879cf875 (patch)
tree5022b0b3504e2dac9a7e82edb00bba8180187c08 /test
parent6c1f616c596e5ffaef8e01daf17f2b583f42fd2d (diff)
downloadale-1e997580fdbb8e11e043af071c97d3aa879cf875.zip
Handle ghc panic in haskell (#4145)
* Add primitive handling of ghc panic. * PascalCase in function. * Add simple test.
Diffstat (limited to 'test')
-rw-r--r--test/handler/test_ghc_handler.vader45
1 files changed, 45 insertions, 0 deletions
diff --git a/test/handler/test_ghc_handler.vader b/test/handler/test_ghc_handler.vader
index b040a234..70246ed1 100644
--- a/test/handler/test_ghc_handler.vader
+++ b/test/handler/test_ghc_handler.vader
@@ -130,3 +130,48 @@ Execute(The ghc handler should handle stack 1.5.1 output):
\ ' 160 | pattern F :: Exp a',
\ ' | ^^^^^',
\ ])
+
+Execute(The ghc handler should handle ghc panic):
+ let g:detail = [
+ \ '[15 of 15] Compiling SizedTypes.List',
+ \ 'ghc: panic! (the ''impossible'' happened)',
+ \ ' (GHC version 8.10.3:',
+ \ ' src/SizedTypes/List.hs:(46,19)-(50,0) Specified type does not refine Haskell type for `SizedTypes.List.out` (Plugged Init types new)',
+ \ ' The Liquid type',
+ \ ' .',
+ \ ' GHC.Types.Int -> (SizedTypes.List.List a) -> (_, (SizedTypes.List.List a))',
+ \ ' .',
+ \ ' is inconsistent with the Haskell type',
+ \ ' .',
+ \ ' forall p a ->',
+ \ 'p -> SizedTypes.List.List a -> (a, SizedTypes.List.List a)',
+ \ ' .',
+ \ ' defined at src/SizedTypes/List.hs:52:1-3',
+ \ ' .',
+ \ ' Specifically, the Liquid component',
+ \ ' .',
+ \ ' {VV##0 : GHC.Types.Int | VV##0 >= 0}',
+ \ ' .',
+ \ ' is inconsistent with the Haskell component',
+ \ ' .',
+ \ ' p',
+ \ ' .',
+ \ ' ',
+ \ ' HINT: Use the hole ''_'' instead of the mismatched component (in the Liquid specification)',
+ \ '',
+ \ 'Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug',
+ \ '',
+ \ ''
+ \ ]
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 1,
+ \ 'type': 'E',
+ \ 'text': 'ghc panic!',
+ \ 'detail': join(g:detail[1:-3], "\n"),
+ \ },
+ \ ],
+ \ ale#handlers#haskell#HandleGHCFormat(bufnr(''), g:detail)
+ unlet g:detail