on master help sign in
Add tests for #246 (#245)

Hover and goto definition only work on the function name in the first clause of a function being defined with multiple equation clauses. Here are some tests that document this.

commitfb66f870fbc79a93999648bd731a8e53920a5094 authorJacek Generowicz <jacg@my-post-office.net> dateSun 15 Dec 2019, 11:43 (7 years ago) parent87f449d
2 files changed+8
test/data/GotoHover.hs+4 test/exe/Main.hs+4
test/data/GotoHover.hs+4
@@ -32,3 +32,7 @@ doBind = do unwrapped <- Just ()
3232
3333listCompBind :: [Char]
3434listCompBind = [ succ c | c <- "abc" ]
35+
36+multipleClause :: Bool -> Char
37+multipleClause True = 't'
38+multipleClause False = 'f'
test/exe/Main.hs+4
@@ -790,6 +790,8 @@ findDefinitionAndHoverTests = let
790790 dnbL30 = Position 30 23
791791 lcbL33 = Position 33 26 ; lcb = [ExpectHoverText [":: Char"], mkR 33 26 33 27]
792792 lclL33 = Position 33 22
793+ mclL36 = Position 36 1 ; mcl = [mkR 36 0 36 14]
794+ mclL37 = Position 37 1
793795 in
794796 mkFindTests
795797 -- def hover look expect
@@ -814,6 +816,8 @@ findDefinitionAndHoverTests = let
814816 , test yes yes dnbL30 dnb "do-notation lookup"
815817 , test yes yes lcbL33 lcb "listcomp bind" -- 137
816818 , test yes yes lclL33 lcb "listcomp lookup"
819+ , test yes yes mclL36 mcl "top-level fn 1st clause"
820+ , test broken broken mclL37 mcl "top-level fn 2nd clause" -- issue #245
817821 ]
818822 where yes, broken :: (TestTree -> Maybe TestTree)
819823 yes = Just -- test should run and pass