Skip to content

Commit b9374aa

Browse files
jacgaherrmann-da
authored andcommitted
Add tests for #237: kinds in hover info (#275)
1 parent bbb75c2 commit b9374aa

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

test/data/GotoHover.hs

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,5 @@ multipleClause True = 't'
3838
multipleClause False = 'f'
3939

4040
-- | Recognizable docs: kpqz
41-
documented = True
41+
documented :: Monad m => Either Int (m a)
42+
documented = Left 3

test/exe/Main.hs

+8-2
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,10 @@ findDefinitionAndHoverTests = let
842842
lclL33 = Position 33 22
843843
mclL36 = Position 36 1 ; mcl = [mkR 36 0 36 14]
844844
mclL37 = Position 37 1
845-
docL40 = Position 40 1 ; doc = [ExpectHoverText ["Recognizable docs: kpqz"]]
845+
docL41 = Position 41 1 ; doc = [ExpectHoverText ["Recognizable docs: kpqz"]]
846+
eitL40 = Position 40 28 ; kindE = [ExpectHoverText [":: * -> * -> *\n"]]
847+
intL40 = Position 40 34 ; kindI = [ExpectHoverText [":: *\n"]]
848+
tvrL40 = Position 40 37 ; kindV = [ExpectHoverText [":: * -> *\n"]]
846849
in
847850
mkFindTests
848851
-- def hover look expect
@@ -869,7 +872,10 @@ findDefinitionAndHoverTests = let
869872
, test yes yes lclL33 lcb "listcomp lookup"
870873
, test yes yes mclL36 mcl "top-level fn 1st clause"
871874
, test yes yes mclL37 mcl "top-level fn 2nd clause #246"
872-
, test no broken docL40 doc "documentation #7"
875+
, test no broken docL41 doc "documentation #7"
876+
, test no broken eitL40 kindE "kind of Either #273"
877+
, test no broken intL40 kindI "kind of Int #273"
878+
, test no broken tvrL40 kindV "kind of (* -> *) type variable #273"
873879
]
874880
where yes, broken :: (TestTree -> Maybe TestTree)
875881
yes = Just -- test should run and pass

0 commit comments

Comments
 (0)