Skip to content

Commit 65fdfa2

Browse files
tdammerssheaf
andauthored
Modify test file the proper way
Co-authored-by: sheaf <sam.derbyshire@gmail.com>
1 parent 894f7a9 commit 65fdfa2

1 file changed

Lines changed: 6 additions & 19 deletions

File tree

  • cabal-testsuite/PackageTests/SetupHooks/SetupHooksRecursiveGlob
Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,8 @@
1-
import Test.Cabal.Prelude
2-
3-
import Control.Monad.Catch (finally)
4-
51
main =
62
setupTest $ do
7-
runSetupTest `finally` cleanup
8-
where
9-
runSetupTest = do
10-
setup "configure" []
11-
setup "build" []
12-
-- Now modify one file and build again to see if that exact file gets rebuilt
13-
env <- getTestEnv
14-
liftIO $ do
15-
let srcDir = testSourceDir env
16-
writeFile (srcDir </> "src/Foo/B.ppExt") "module Foo.B where\nModified text"
17-
setup "build" []
18-
cleanup = do
19-
env <- getTestEnv
20-
let srcDir = testSourceDir env
21-
liftIO $ writeFile (srcDir </> "src/Foo/B.ppExt") "module Foo.B where\nOriginal text\n"
3+
setup "configure" []
4+
setup "build" []
5+
-- Modify one file in the temp copy (testCurrentDir) and rebuild; only
6+
-- the preprocessor rule for Foo.B should re-run, not the one for A.
7+
writeSourceFile "src/Foo/B.ppExt" "module Foo.B where\nModified text"
8+
setup "build" []

0 commit comments

Comments
 (0)