1 import Test
.Cabal
.Prelude
2 import Data
.List
(isPrefixOf)
4 main
= skipIfCIAndWindows
10230 >> cabalTest
(flakyIfCI
9530 $ withProjectFile
"cabal.project" $ withRemoteRepo
"repo" $ do
9 . filter ("Index cache updated to index-state " `
isPrefixOf`
)
12 <$> recordMode DoNotRecord
(cabal
' "update" [])
13 -- update golden output with actual timestamp
14 shell
"cp" ["cabal.out.in", "cabal.out"]
15 shell
"sed" [ "-i" ++ if not isWindows
then "''" else "", "-e", "s/REPLACEME/" <> output
<> "/g", "cabal.out"]
16 -- This shall fail with an error message as specified in `cabal.out`
17 fails
$ cabal
"build" ["--index-state=4000-01-01T00:00:00Z", "fake-pkg"]
18 -- This shall fail by not finding the package, what indicates that it
19 -- accepted an older index-state.
20 fails
$ cabal
"build" ["--index-state=2023-01-01T00:00:00Z", "fake-pkg"])