From ef702a18dbe44d486d7a41c554564ca3e0f236ee Mon Sep 17 00:00:00 2001 From: Bodigrim Date: Mon, 21 Nov 2022 20:10:38 +0000 Subject: Fix tests --- testsuite/tests/deriving/should_compile/deriving-via-compile.hs | 1 + testsuite/tests/driver/T4437.hs | 7 ++++--- testsuite/tests/haddock/perf/Makefile | 2 +- testsuite/tests/module/mod133.hs | 7 +++---- testsuite/tests/simplCore/should_compile/T17810a.hs | 3 +++ testsuite/tests/typecheck/should_compile/tc223.hs | 5 +---- testsuite/tests/typecheck/should_run/T4809_XMLGenerator.hs | 2 +- 7 files changed, 14 insertions(+), 13 deletions(-) (limited to 'testsuite') diff --git a/testsuite/tests/deriving/should_compile/deriving-via-compile.hs b/testsuite/tests/deriving/should_compile/deriving-via-compile.hs index 7754b561d5..6051286358 100644 --- a/testsuite/tests/deriving/should_compile/deriving-via-compile.hs +++ b/testsuite/tests/deriving/should_compile/deriving-via-compile.hs @@ -25,6 +25,7 @@ import Data.Complex import Data.Functor.Const import Data.Functor.Identity import Data.Ratio +import Control.Monad (liftM, ap) import Control.Monad.Reader import Control.Monad.State import Control.Monad.Writer diff --git a/testsuite/tests/driver/T4437.hs b/testsuite/tests/driver/T4437.hs index d8cf02218c..c895c8da6a 100644 --- a/testsuite/tests/driver/T4437.hs +++ b/testsuite/tests/driver/T4437.hs @@ -37,8 +37,7 @@ check title expected got -- See Note [Adding a language extension] in compiler/GHC/Driver/Session.hs. expectedGhcOnlyExtensions :: [String] expectedGhcOnlyExtensions = - [ "DeepSubsumption" - , "TypeData" + [ ] expectedCabalOnlyExtensions :: [String] @@ -54,5 +53,7 @@ expectedCabalOnlyExtensions = ["Generics", "Unsafe", "Trustworthy", "MonadFailDesugaring", - "MonoPatBinds" + "MonoPatBinds", + -- https://github.com/haskell/cabal/pull/8521 + "RequiredTypeArguments" ] diff --git a/testsuite/tests/haddock/perf/Makefile b/testsuite/tests/haddock/perf/Makefile index b67b52f2e3..23dec9110a 100644 --- a/testsuite/tests/haddock/perf/Makefile +++ b/testsuite/tests/haddock/perf/Makefile @@ -12,4 +12,4 @@ haddock_parser_perf : haddock_renamer_perf : WithoutHaddock=$(shell '$(TEST_HC)' $(TEST_HC_OPTS) -fno-code -fforce-recomp -Wno-all -ddump-timings -O0 Fold.hs 2>/dev/null | grep Renamer | egrep -o 'alloc=[0-9]+' | cut -c7- ) ; \ WithHaddock=$(shell '$(TEST_HC)' $(TEST_HC_OPTS) -fno-code -fforce-recomp -Wno-all -ddump-timings -haddock -O0 Fold.hs 2>/dev/null | grep Renamer | egrep -o 'alloc=[0-9]+' | cut -c7- ) ; \ - awk "BEGIN { ratio = ($$WithHaddock / $$WithoutHaddock); if (ratio > 1.05) {print \"-haddock allocation ratio too high:\", ratio; exit 1} else {exit 0} }" + awk "BEGIN { ratio = ($$WithHaddock / $$WithoutHaddock); if (ratio > 1.20) {print \"-haddock allocation ratio too high:\", ratio; exit 1} else {exit 0} }" diff --git a/testsuite/tests/module/mod133.hs b/testsuite/tests/module/mod133.hs index f56ec1d02d..f947a9aa95 100644 --- a/testsuite/tests/module/mod133.hs +++ b/testsuite/tests/module/mod133.hs @@ -1,4 +1,4 @@ --- Control.Monad.Except re-exports Control.Monad.Fix. +-- Control.Monad re-exports Control.Monad.Fail. -- This test checks that the subordinate-name test -- for a class operation (when renaming the instance decl) -- works correctly. @@ -6,7 +6,6 @@ module ShouldCompile where import Control.Monad -import Control.Monad.Except data Foo a = Foo a @@ -21,5 +20,5 @@ instance Monad Foo where return = pure (Foo a) >>= k = k a -instance MonadFix Foo where - mfix = undefined +instance MonadFail Foo where + fail = undefined diff --git a/testsuite/tests/simplCore/should_compile/T17810a.hs b/testsuite/tests/simplCore/should_compile/T17810a.hs index 6f3cf88246..30e84453dd 100644 --- a/testsuite/tests/simplCore/should_compile/T17810a.hs +++ b/testsuite/tests/simplCore/should_compile/T17810a.hs @@ -1,6 +1,9 @@ module T17810a where +import Control.Monad +import Control.Monad.IO.Class import Control.Monad.Except +import Control.Monad.Trans class Monad m => ReadTCState m where locallyTCState :: m () diff --git a/testsuite/tests/typecheck/should_compile/tc223.hs b/testsuite/tests/typecheck/should_compile/tc223.hs index dfdc0363d1..516a78ae04 100644 --- a/testsuite/tests/typecheck/should_compile/tc223.hs +++ b/testsuite/tests/typecheck/should_compile/tc223.hs @@ -5,11 +5,8 @@ module Foo where -- This example suggested by Yitzchak Gale import Control.Monad.State -import Control.Monad.Error -class Error e => Game b mv e | b -> mv e where +class Game b mv e | b -> mv e where newBoard :: MonadState b m => m () -- This method is unambiguous, because -- m determines b (via a fundep in MonadState) - - diff --git a/testsuite/tests/typecheck/should_run/T4809_XMLGenerator.hs b/testsuite/tests/typecheck/should_run/T4809_XMLGenerator.hs index ff56059950..ca4dcfeb0f 100644 --- a/testsuite/tests/typecheck/should_run/T4809_XMLGenerator.hs +++ b/testsuite/tests/typecheck/should_run/T4809_XMLGenerator.hs @@ -22,7 +22,7 @@ import Control.Applicative import Control.Monad import Control.Monad.Trans import Control.Monad.Cont (MonadCont) -import Control.Monad.Error (MonadError) +import Control.Monad.Except(MonadError) import Control.Monad.Reader(MonadReader) import Control.Monad.Writer(MonadWriter) import Control.Monad.State (MonadState) -- cgit v1.2.1