@@ -6,12 +6,12 @@ import Language.Haskell.LSP.Types
6
6
import System.Directory
7
7
import Test.Hls.Util
8
8
import Test.Tasty
9
- import Test.Tasty.ExpectedFailure (ignoreTestBecause )
10
9
import Test.Tasty.HUnit
10
+ import Test.Tasty.ExpectedFailure (expectFailBecause )
11
11
12
12
tests :: TestTree
13
13
tests = testGroup " type definitions" [
14
- ignoreTestBecause " Broken " $ testCase " finds local definition of record variable"
14
+ testCase " finds local definition of record variable"
15
15
$ runSession hlsCommand fullCaps " test/testdata/gototest"
16
16
$ do
17
17
doc <- openDoc " src/Lib.hs" " haskell"
@@ -21,7 +21,8 @@ tests = testGroup "type definitions" [
21
21
defs @?= [ Location (filePathToUri fp)
22
22
(Range (toPos (8 , 1 )) (toPos (8 , 29 )))
23
23
]
24
- , ignoreTestBecause " Broken" $ testCase " finds local definition of newtype variable"
24
+
25
+ , testCase " finds local definition of newtype variable"
25
26
$ runSession hlsCommand fullCaps " test/testdata/gototest"
26
27
$ do
27
28
doc <- openDoc " src/Lib.hs" " haskell"
@@ -31,7 +32,8 @@ tests = testGroup "type definitions" [
31
32
defs @?= [ Location (filePathToUri fp)
32
33
(Range (toPos (13 , 1 )) (toPos (13 , 30 )))
33
34
]
34
- , ignoreTestBecause " Broken" $ testCase " finds local definition of sum type variable"
35
+
36
+ , testCase " finds local definition of sum type variable"
35
37
$ runSession hlsCommand fullCaps " test/testdata/gototest"
36
38
$ do
37
39
doc <- openDoc " src/Lib.hs" " haskell"
@@ -41,7 +43,8 @@ tests = testGroup "type definitions" [
41
43
defs @?= [ Location (filePathToUri fp)
42
44
(Range (toPos (18 , 1 )) (toPos (18 , 26 )))
43
45
]
44
- , ignoreTestBecause " Broken" $ testCase " finds local definition of sum type contructor"
46
+
47
+ , testCase " finds local definition of sum type constructor"
45
48
$ runSession hlsCommand fullCaps " test/testdata/gototest"
46
49
$ do
47
50
doc <- openDoc " src/Lib.hs" " haskell"
@@ -52,27 +55,32 @@ tests = testGroup "type definitions" [
52
55
@?= [ Location (filePathToUri fp)
53
56
(Range (toPos (18 , 1 )) (toPos (18 , 26 )))
54
57
]
55
- , ignoreTestBecause " Broken" $ testCase " can not find non-local definition of type def"
58
+
59
+ , testCase " finds non-local definition of type def"
56
60
$ runSession hlsCommand fullCaps " test/testdata/gototest"
57
61
$ do
58
62
doc <- openDoc " src/Lib.hs" " haskell"
59
63
defs <- getTypeDefinitions doc (toPos (30 , 17 ))
60
- liftIO $ defs @?= []
64
+ liftIO $ do
65
+ fp <- canonicalizePath " test/testdata/gototest/src/Lib.hs"
66
+ defs
67
+ @?= [ Location (filePathToUri fp)
68
+ (Range (toPos (27 , 1 )) (toPos (27 , 17 )))
69
+ ]
61
70
62
- , ignoreTestBecause " Broken " $ testCase " find local definition of type def"
71
+ , testCase " find local definition of type def"
63
72
$ runSession hlsCommand fullCaps " test/testdata/gototest"
64
73
$ do
65
74
doc <- openDoc " src/Lib.hs" " haskell"
66
75
defs <- getTypeDefinitions doc (toPos (35 , 16 ))
67
76
liftIO $ do
68
77
fp <- canonicalizePath " test/testdata/gototest/src/Lib.hs"
69
78
defs @?= [ Location (filePathToUri fp)
70
- (Range (toPos (18 , 1 )) (toPos (18 , 26 )))
79
+ (Range (toPos (32 , 1 )) (toPos (32 , 18 )))
71
80
]
72
81
73
- {- - TODO Implement
74
- , ignoreTestBecause "Broken" $ testCase "find type-definition of type def in component"
75
- $ pendingWith "Finding symbols cross module is currently not supported"
82
+ , expectFailBecause " This test is broken because it needs a proper cradle." $
83
+ testCase " find type-definition of type def in component"
76
84
$ runSession hlsCommand fullCaps " test/testdata/gototest"
77
85
$ do
78
86
doc <- openDoc " src/Lib2.hs" " haskell"
@@ -85,8 +93,8 @@ tests = testGroup "type definitions" [
85
93
@?= [ Location (filePathToUri fp)
86
94
(Range (toPos (8 , 1 )) (toPos (8 , 29 )))
87
95
]
88
- - -}
89
- , ignoreTestBecause " Broken " $ testCase " find definition of parameterized data type"
96
+
97
+ , testCase " find definition of parameterized data type"
90
98
$ runSession hlsCommand fullCaps " test/testdata/gototest"
91
99
$ do
92
100
doc <- openDoc " src/Lib.hs" " haskell"
0 commit comments