diff --git a/tests/integration/tests/haddock-options/Main.hs b/tests/integration/tests/haddock-options/Main.hs index 28cda62853..3e2a4bc98a 100644 --- a/tests/integration/tests/haddock-options/Main.hs +++ b/tests/integration/tests/haddock-options/Main.hs @@ -1,17 +1,18 @@ -import StackTest +import Control.Monad ( unless ) +import Data.List ( isInfixOf ) +import StackTest main :: IO () main = do - removeDirIgnore ".stack-work" + removeDirIgnore ".stack-work" --- Disabling the test with GHC 9.8.4 because, unlike earlier versions, it fails --- to fail, despite the Haddock options working as expected. --- --- -- Fails to work because BAR is defined here and FOO in stack file --- stackErr ["haddock", "--haddock-arguments", "--optghc=-DBAR"] - stack ["clean"] - -- Works just fine, test #3099 while at it. - stack ["haddock", "--no-haddock-hyperlink-source"] - stack ["clean"] - -- Fails to work because we have bad argument - stackErr ["haddock", "--haddock-arguments", "--stack_it_badhaddockargument"] + -- BAR is defined here and FOO in stack.yaml file + stackCheckStdErr ["haddock", "--haddock-arguments", "--optghc=-DBAR"] $ \s -> + unless ("error: error: FOO and BAR is defined" `isInfixOf` s) $ + error "FOO and BAR not both defined" + stack ["clean"] + -- Works just fine, test #3099 while at it. + stack ["haddock", "--no-haddock-hyperlink-source"] + stack ["clean"] + -- Fails to work because we have bad argument + stackErr ["haddock", "--haddock-arguments", "--stack_it_badhaddockargument"]