Skip to content

Commit acc8c6b

Browse files
jacgcocreature
authored andcommitted
Add tests for #274: literals in hover info (#276)
Tests for issue #274.
1 parent b9374aa commit acc8c6b

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

test/data/GotoHover.hs

+7-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ data TypeConstructor = DataConstructor
66
, ggg :: Int }
77
aaa :: TypeConstructor
88
aaa = DataConstructor
9-
{ fff = ""
10-
, ggg = 0
9+
{ fff = "dfgy"
10+
, ggg = 832
1111
}
1212
bbb :: TypeConstructor
13-
bbb = DataConstructor "" 0
13+
bbb = DataConstructor "mjgp" 2994
1414
ccc :: (Text, Int)
1515
ccc = (fff bbb, ggg aaa)
1616
ddd :: Num a => a -> a -> a
@@ -31,12 +31,14 @@ doBind = do unwrapped <- Just ()
3131
return unwrapped
3232

3333
listCompBind :: [Char]
34-
listCompBind = [ succ c | c <- "abc" ]
34+
listCompBind = [ succ c | c <- "ptfx" ]
3535

3636
multipleClause :: Bool -> Char
3737
multipleClause True = 't'
3838
multipleClause False = 'f'
3939

4040
-- | Recognizable docs: kpqz
4141
documented :: Monad m => Either Int (m a)
42-
documented = Left 3
42+
documented = Left 7518
43+
44+
listOfInt = [ 8391 :: Int, 6268 ]

test/exe/Main.hs

+8
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,10 @@ findDefinitionAndHoverTests = let
846846
eitL40 = Position 40 28 ; kindE = [ExpectHoverText [":: * -> * -> *\n"]]
847847
intL40 = Position 40 34 ; kindI = [ExpectHoverText [":: *\n"]]
848848
tvrL40 = Position 40 37 ; kindV = [ExpectHoverText [":: * -> *\n"]]
849+
intL41 = Position 41 20 ; litI = [ExpectHoverText ["7518"]]
850+
chrL36 = Position 36 25 ; litC = [ExpectHoverText ["'t'"]]
851+
txtL8 = Position 8 14 ; litT = [ExpectHoverText ["\"dfgv\""]]
852+
lstL43 = Position 43 12 ; litL = [ExpectHoverText ["[ 8391 :: Int, 6268 ]"]]
849853
in
850854
mkFindTests
851855
-- def hover look expect
@@ -876,6 +880,10 @@ findDefinitionAndHoverTests = let
876880
, test no broken eitL40 kindE "kind of Either #273"
877881
, test no broken intL40 kindI "kind of Int #273"
878882
, test no broken tvrL40 kindV "kind of (* -> *) type variable #273"
883+
, test no broken intL41 litI "literal Int in hover info #274"
884+
, test no broken chrL36 litC "literal Char in hover info #274"
885+
, test no broken txtL8 litT "literal Text in hover info #274"
886+
, test no broken lstL43 litL "literal List in hover info #274"
879887
]
880888
where yes, broken :: (TestTree -> Maybe TestTree)
881889
yes = Just -- test should run and pass

0 commit comments

Comments
 (0)