on master help sign in
Tests for issue #237 (#238)

* Add tests for issue #237 * Tell hlint to ignore test sample code * Add test showing similar problem in listcomps * Identify implementation necessary for test to pass

commit4e8178dbcca34865fd2bda461d8e1551f8679146 authorJacek Generowicz <jacg@my-post-office.net> dateFri 13 Dec 2019, 14:07 (7 years ago) parent9feb7c7
2 files changed+17−2
test/data/GotoHover.hs+8−1 test/exe/Main.hs+9−1
test/data/GotoHover.hs+8−1
@@ -1,4 +1,4 @@
1−
1+{- HLINT ignore -}
22module Testing ( module Testing )where
33import Data.Text (Text, pack)
44data TypeConstructor = DataConstructor
@@ -25,3 +25,10 @@ instance Class Int where
2525 method = succ
2626kkk :: Class a => Int -> a -> Int
2727kkk 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
786786 clL23 = Position 23 11 ; cls = [mkR 21 0 22 20]
787787 clL25 = Position 25 9
788788 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
789793 in
790794 mkFindTests
791795 -- def hover look expect
@@ -806,11 +810,15 @@ findDefinitionAndHoverTests = let
806810 , test yes broken clL23 cls "class in instance declaration"
807811 , test yes broken clL25 cls "class in signature" -- 147
808812 , 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"
809817 ]
810818 where yes, broken :: (TestTree -> Maybe TestTree)
811819 yes = Just -- test should run and pass
812820 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
814822
815823pluginTests :: TestTree
816824pluginTests = testSessionWait "plugins" $ do