on master help sign in
Tests for issue #237 (#238)
4e8178dJacek Generowicz
test/data/GotoHover.hs+8−1
@@ -1,4 +1,4 @@
1−
1+{- HLINT ignore -}
2module Testing ( module Testing )where
2module Testing ( module Testing )where
3import Data.Text (Text, pack)
3import Data.Text (Text, pack)
4data TypeConstructor = DataConstructor
4data TypeConstructor = DataConstructor
@@ -25,3 +25,10 @@ instance Class Int where
25 method = succ
25 method = succ
26kkk :: Class a => Int -> a -> Int
26kkk :: Class a => Int -> a -> Int
27kkk n c = n + method c
27kkk n c = n + method c
28+
29+doBind :: Maybe ()
30+doBind = do unwrapped <- Just ()
31+ return unwrapped
32+
33+listCompBind :: [Char]
34+listCompBind = [ succ c | c <- "abc" ]
test/exe/Main.hs+9−1
@@ -786,6 +786,10 @@ findDefinitionAndHoverTests = let
786 clL23 = Position 23 11 ; cls = [mkR 21 0 22 20]
786 clL23 = Position 23 11 ; cls = [mkR 21 0 22 20]
787 clL25 = Position 25 9
787 clL25 = Position 25 9
788 eclL15 = Position 15 8 ; ecls = [ExpectHoverText ["Num"], ExpectExternFail]
788 eclL15 = Position 15 8 ; ecls = [ExpectHoverText ["Num"], ExpectExternFail]
789+ dnbL29 = Position 29 18 ; dnb = [ExpectHoverText [":: ()"], mkR 29 12 29 21]
790+ dnbL30 = Position 30 23
791+ lcbL33 = Position 33 26 ; lcb = [ExpectHoverText [":: Char"], mkR 33 26 33 27]
792+ lclL33 = Position 33 22
789 in
793 in
790 mkFindTests
794 mkFindTests
791 -- def hover look expect
795 -- def hover look expect
@@ -806,11 +810,15 @@ findDefinitionAndHoverTests = let
806 , test yes broken clL23 cls "class in instance declaration"
810 , test yes broken clL23 cls "class in instance declaration"
807 , test yes broken clL25 cls "class in signature" -- 147
811 , test yes broken clL25 cls "class in signature" -- 147
808 , test broken broken eclL15 ecls "external class in signature"
812 , test broken broken eclL15 ecls "external class in signature"
813+ , test yes broken dnbL29 dnb "do-notation bind" -- 137
814+ , test yes yes dnbL30 dnb "do-notation lookup"
815+ , test yes broken lcbL33 lcb "listcomp bind" -- 137
816+ , test yes yes lclL33 lcb "listcomp lookup"
809 ]
817 ]
810 where yes, broken :: (TestTree -> Maybe TestTree)
818 where yes, broken :: (TestTree -> Maybe TestTree)
811 yes = Just -- test should run and pass
819 yes = Just -- test should run and pass
812 broken = Just . (`xfail` "known broken")
820 broken = Just . (`xfail` "known broken")
813− -- no = const Nothing -- don't run this test at all
821+ -- no = const Nothing -- don't run this test at all
814
822
815pluginTests :: TestTree
823pluginTests :: TestTree
816pluginTests = testSessionWait "plugins" $ do
824pluginTests = testSessionWait "plugins" $ do