Skip to content

Commit 79c4caa

Browse files
committed
Multi component: test with 3 components
1 parent 019a6e0 commit 79c4caa

File tree

5 files changed

+31
-2
lines changed

5 files changed

+31
-2
lines changed

ghcide/test/data/multi/c/C.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module C(module C) where
2+
import A
3+
cux = foo

ghcide/test/data/multi/c/c.cabal

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: c
2+
version: 1.0.0
3+
build-type: Simple
4+
cabal-version: >= 1.2
5+
6+
library
7+
build-depends: base, a
8+
exposed-modules: C
9+
hs-source-dirs: .

ghcide/test/data/multi/cabal.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
packages: a b
1+
packages: a b c

ghcide/test/data/multi/hie.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ cradle:
44
component: "lib:a"
55
- path: "./b"
66
component: "lib:b"
7+
- path: "./c"
8+
component: "lib:c"

ghcide/test/exe/Main.hs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5364,7 +5364,7 @@ cradleTests = testGroup "cradle"
53645364
[testGroup "dependencies" [sessionDepsArePickedUp]
53655365
,testGroup "ignore-fatal" [ignoreFatalWarning]
53665366
,testGroup "loading" [loadCradleOnlyonce, retryFailedCradle]
5367-
,testGroup "multi" [simpleMultiTest, simpleMultiTest2, simpleMultiDefTest]
5367+
,testGroup "multi" [simpleMultiTest, simpleMultiTest2, simpleMultiTest3, simpleMultiDefTest]
53685368
,testGroup "sub-directory" [simpleSubDirectoryTest]
53695369
]
53705370

@@ -5508,6 +5508,21 @@ simpleMultiTest2 = testCase "simple-multi-test2" $ runWithExtraFiles "multi" $ \
55085508
let fooL = mkL auri 2 0 2 3
55095509
checkDefs locs (pure [fooL])
55105510
expectNoMoreDiagnostics 0.5
5511+
5512+
-- Now with 3 components
5513+
simpleMultiTest3 :: TestTree
5514+
simpleMultiTest3 = testCase "simple-multi-test3" $ runWithExtraFiles "multi" $ \dir -> do
5515+
let aPath = dir </> "a/A.hs"
5516+
bPath = dir </> "b/B.hs"
5517+
cPath = dir </> "c/C.hs"
5518+
bdoc <- openDoc bPath "haskell"
5519+
WaitForIdeRuleResult {} <- waitForAction "TypeCheck" bdoc
5520+
adoc@(TextDocumentIdentifier auri) <- openDoc aPath "haskell"
5521+
WaitForIdeRuleResult {} <- waitForAction "TypeCheck" adoc
5522+
cdoc <- openDoc cPath "haskell"
5523+
WaitForIdeRuleResult {} <- waitForAction "TypeCheck" cdoc
5524+
locs <- getDefinitions cdoc (Position 2 7)
5525+
let fooL = mkL auri 2 0 2 3
55115526
checkDefs locs (pure [fooL])
55125527
expectNoMoreDiagnostics 0.5
55135528

0 commit comments

Comments
 (0)