Skip to content

Commit 4f016dd

Browse files
committed
Sanitize hiding tests
These tests are reimplementing runWithExtraFiles - let's just use it
1 parent 78ea4f3 commit 4f016dd

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

Diff for: ghcide/test/exe/Main.hs

+2-7
Original file line numberDiff line numberDiff line change
@@ -2119,20 +2119,15 @@ suggestImportDisambiguationTests = testGroup "suggest import disambiguation acti
21192119
]
21202120
]
21212121
where
2122-
hidingDir = "test/data/hiding"
21232122
compareTwo original locs cmd expected =
21242123
withTarget original locs $ \doc actions -> do
2125-
expected <- liftIO $
2126-
readFileUtf8 (hidingDir </> expected)
2124+
expected <- liftIO $ readFileUtf8 expected
21272125
action <- liftIO $ pickActionWithTitle cmd actions
21282126
executeCodeAction action
21292127
contentAfterAction <- documentContents doc
21302128
liftIO $ T.replace "\r\n" "\n" expected @=? contentAfterAction
21312129
compareHideFunctionTo = compareTwo "HideFunction.hs"
2132-
auxFiles = ["AVec.hs", "BVec.hs", "CVec.hs", "DVec.hs", "EVec.hs", "FVec.hs"]
2133-
withTarget file locs k = withTempDir $ \dir -> runInDir dir $ do
2134-
liftIO $ mapM_ (\fp -> copyFile (hidingDir </> fp) $ dir </> fp)
2135-
$ file : auxFiles
2130+
withTarget file locs k = runWithExtraFiles "hiding" $ \dir -> do
21362131
doc <- openDoc file "haskell"
21372132
waitForProgressDone
21382133
void $ expectDiagnostics [(file, [(DsError, loc, "Ambiguous occurrence") | loc <- locs])]

0 commit comments

Comments
 (0)