Skip to content

Commit 8b041a9

Browse files
committed
Multi component: test with 3 components
1 parent bdf8532 commit 8b041a9

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
@@ -5373,7 +5373,7 @@ cradleTests = testGroup "cradle"
53735373
[testGroup "dependencies" [sessionDepsArePickedUp]
53745374
,testGroup "ignore-fatal" [ignoreFatalWarning]
53755375
,testGroup "loading" [loadCradleOnlyonce, retryFailedCradle]
5376-
,testGroup "multi" [simpleMultiTest, simpleMultiTest2, simpleMultiDefTest]
5376+
,testGroup "multi" [simpleMultiTest, simpleMultiTest2, simpleMultiTest3, simpleMultiDefTest]
53775377
,testGroup "sub-directory" [simpleSubDirectoryTest]
53785378
]
53795379

@@ -5517,6 +5517,21 @@ simpleMultiTest2 = testCase "simple-multi-test2" $ runWithExtraFiles "multi" $ \
55175517
let fooL = mkL auri 2 0 2 3
55185518
checkDefs locs (pure [fooL])
55195519
expectNoMoreDiagnostics 0.5
5520+
5521+
-- Now with 3 components
5522+
simpleMultiTest3 :: TestTree
5523+
simpleMultiTest3 = testCase "simple-multi-test3" $ runWithExtraFiles "multi" $ \dir -> do
5524+
let aPath = dir </> "a/A.hs"
5525+
bPath = dir </> "b/B.hs"
5526+
cPath = dir </> "c/C.hs"
5527+
bdoc <- openDoc bPath "haskell"
5528+
WaitForIdeRuleResult {} <- waitForAction "TypeCheck" bdoc
5529+
adoc@(TextDocumentIdentifier auri) <- openDoc aPath "haskell"
5530+
WaitForIdeRuleResult {} <- waitForAction "TypeCheck" adoc
5531+
cdoc <- openDoc cPath "haskell"
5532+
WaitForIdeRuleResult {} <- waitForAction "TypeCheck" cdoc
5533+
locs <- getDefinitions cdoc (Position 2 7)
5534+
let fooL = mkL auri 2 0 2 3
55205535
checkDefs locs (pure [fooL])
55215536
expectNoMoreDiagnostics 0.5
55225537

0 commit comments

Comments
 (0)