Skip to content

Commit fb66f87

Browse files
jacgcocreature
authored andcommitted
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.
1 parent 87f449d commit fb66f87

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

test/data/GotoHover.hs

+4
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,7 @@ doBind = do unwrapped <- Just ()
3232

3333
listCompBind :: [Char]
3434
listCompBind = [ succ c | c <- "abc" ]
35+
36+
multipleClause :: Bool -> Char
37+
multipleClause True = 't'
38+
multipleClause False = 'f'

test/exe/Main.hs

+4
Original file line numberDiff line numberDiff line change
@@ -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

0 commit comments

Comments
 (0)