on master help sign in
Add tests for #274: literals in hover info (#276)

Tests for issue #274.

commitacc8c6b609f5dc52117bad6aaab1ede36283db76 authorJacek Generowicz <jacg@my-post-office.net> dateWed 18 Dec 2019, 14:48 (7 years ago) parentb9374aa
2 files changed+15−5
test/data/GotoHover.hs+7−5 test/exe/Main.hs+8
test/data/GotoHover.hs+7−5
@@ -6,11 +6,11 @@ data TypeConstructor = DataConstructor
66 , ggg :: Int }
77aaa :: TypeConstructor
88aaa = DataConstructor
9− { fff = ""
10− , ggg = 0
9+ { fff = "dfgy"
10+ , ggg = 832
1111 }
1212bbb :: TypeConstructor
13−bbb = DataConstructor "" 0
13+bbb = DataConstructor "mjgp" 2994
1414ccc :: (Text, Int)
1515ccc = (fff bbb, ggg aaa)
1616ddd :: Num a => a -> a -> a
@@ -31,7 +31,7 @@ doBind = do unwrapped <- Just ()
3131 return unwrapped
3232
3333listCompBind :: [Char]
34−listCompBind = [ succ c | c <- "abc" ]
34+listCompBind = [ succ c | c <- "ptfx" ]
3535
3636multipleClause :: Bool -> Char
3737multipleClause True = 't'
@@ -39,4 +39,6 @@ multipleClause False = 'f'
3939
4040-- | Recognizable docs: kpqz
4141documented :: 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
@@ -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