packages feed

HMock 0.5.1.2 → 0.5.2.0

raw patch · 13 files changed

+46/−59 lines, 13 filesdep −constraintsdep −directorydep −monad-controldep ~basedep ~containersdep ~data-defaultPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependencies removed: constraints, directory, monad-control

Dependency ranges changed: base, containers, data-default, extra, template-haskell

API changes (from Hackage documentation)

- Test.HMock.TH: instance Data.Default.Class.Default Test.HMock.TH.MakeMockableOptions
+ Test.HMock.TH: instance Data.Default.Internal.Default Test.HMock.TH.MakeMockableOptions
- Test.HMock.ExpectContext: anyOf :: (ExpectContext ctx, MonadIO m) => (forall ctx'. ExpectContext ctx' => [ctx' m ()]) -> ctx m ()
+ Test.HMock.ExpectContext: anyOf :: forall (m :: Type -> Type). (ExpectContext ctx, MonadIO m) => (forall (ctx' :: (Type -> Type) -> Type -> Type). ExpectContext ctx' => [ctx' m ()]) -> ctx m ()
- Test.HMock.ExpectContext: class ExpectContext (ctx :: (Type -> Type) -> Type -> Type)
+ Test.HMock.ExpectContext: class ExpectContext (ctx :: Type -> Type -> Type -> Type)
- Test.HMock.ExpectContext: consecutiveTimes :: (ExpectContext ctx, MonadIO m) => Multiplicity -> (forall ctx'. ExpectContext ctx' => ctx' m ()) -> ctx m ()
+ Test.HMock.ExpectContext: consecutiveTimes :: forall (m :: Type -> Type). (ExpectContext ctx, MonadIO m) => Multiplicity -> (forall (ctx' :: (Type -> Type) -> Type -> Type). ExpectContext ctx' => ctx' m ()) -> ctx m ()
- Test.HMock.ExpectContext: expect :: (ExpectContext ctx, HasCallStack, MonadIO m, MockableMethod cls name m r, Expectable cls name m r expectable) => expectable -> ctx m ()
+ Test.HMock.ExpectContext: expect :: forall (m :: Type -> Type) (cls :: (Type -> Type) -> Constraint) (name :: Symbol) r expectable. (ExpectContext ctx, HasCallStack, MonadIO m, MockableMethod cls name m r, Expectable cls name m r expectable) => expectable -> ctx m ()
- Test.HMock.ExpectContext: expectAny :: (ExpectContext ctx, HasCallStack, MonadIO m, MockableMethod cls name m r, Expectable cls name m r expectable) => expectable -> ctx m ()
+ Test.HMock.ExpectContext: expectAny :: forall (m :: Type -> Type) (cls :: (Type -> Type) -> Constraint) (name :: Symbol) r expectable. (ExpectContext ctx, HasCallStack, MonadIO m, MockableMethod cls name m r, Expectable cls name m r expectable) => expectable -> ctx m ()
- Test.HMock.ExpectContext: expectN :: (ExpectContext ctx, HasCallStack, MonadIO m, MockableMethod cls name m r, Expectable cls name m r expectable) => Multiplicity -> expectable -> ctx m ()
+ Test.HMock.ExpectContext: expectN :: forall (m :: Type -> Type) (cls :: (Type -> Type) -> Constraint) (name :: Symbol) r expectable. (ExpectContext ctx, HasCallStack, MonadIO m, MockableMethod cls name m r, Expectable cls name m r expectable) => Multiplicity -> expectable -> ctx m ()
- Test.HMock.ExpectContext: inAnyOrder :: (ExpectContext ctx, MonadIO m) => (forall ctx'. ExpectContext ctx' => [ctx' m ()]) -> ctx m ()
+ Test.HMock.ExpectContext: inAnyOrder :: forall (m :: Type -> Type). (ExpectContext ctx, MonadIO m) => (forall (ctx' :: (Type -> Type) -> Type -> Type). ExpectContext ctx' => [ctx' m ()]) -> ctx m ()
- Test.HMock.ExpectContext: inSequence :: (ExpectContext ctx, MonadIO m) => (forall ctx'. ExpectContext ctx' => [ctx' m ()]) -> ctx m ()
+ Test.HMock.ExpectContext: inSequence :: forall (m :: Type -> Type). (ExpectContext ctx, MonadIO m) => (forall (ctx' :: (Type -> Type) -> Type -> Type). ExpectContext ctx' => [ctx' m ()]) -> ctx m ()
- Test.HMock.ExpectContext: times :: (ExpectContext ctx, MonadIO m) => Multiplicity -> (forall ctx'. ExpectContext ctx' => ctx' m ()) -> ctx m ()
+ Test.HMock.ExpectContext: times :: forall (m :: Type -> Type). (ExpectContext ctx, MonadIO m) => Multiplicity -> (forall (ctx' :: (Type -> Type) -> Type -> Type). ExpectContext ctx' => ctx' m ()) -> ctx m ()
- Test.HMock.ExpectContext: type MockableMethod (cls :: (Type -> Type) -> Constraint) (name :: Symbol) (m :: Type -> Type) (r :: Type) = (Mockable cls, Typeable m, KnownSymbol name, Typeable r)
+ Test.HMock.ExpectContext: type MockableMethod (cls :: Type -> Type -> Constraint) (name :: Symbol) (m :: Type -> Type) r = (Mockable cls, Typeable m, KnownSymbol name, Typeable r)
- Test.HMock.Internal.ExpectSet: [CollectedChoice] :: [CollectedSet step] -> CollectedSet step
+ Test.HMock.Internal.ExpectSet: [CollectedChoice] :: forall step. [CollectedSet step] -> CollectedSet step
- Test.HMock.Internal.ExpectSet: [CollectedConsecutive] :: Multiplicity -> CollectedSet step -> CollectedSet step
+ Test.HMock.Internal.ExpectSet: [CollectedConsecutive] :: forall step. Multiplicity -> CollectedSet step -> CollectedSet step
- Test.HMock.Internal.ExpectSet: [CollectedInterleave] :: [CollectedSet step] -> CollectedSet step
+ Test.HMock.Internal.ExpectSet: [CollectedInterleave] :: forall step. [CollectedSet step] -> CollectedSet step
- Test.HMock.Internal.ExpectSet: [CollectedMulti] :: Multiplicity -> CollectedSet step -> CollectedSet step
+ Test.HMock.Internal.ExpectSet: [CollectedMulti] :: forall step. Multiplicity -> CollectedSet step -> CollectedSet step
- Test.HMock.Internal.ExpectSet: [CollectedNothing] :: CollectedSet step
+ Test.HMock.Internal.ExpectSet: [CollectedNothing] :: forall step. CollectedSet step
- Test.HMock.Internal.ExpectSet: [CollectedSequence] :: [CollectedSet step] -> CollectedSet step
+ Test.HMock.Internal.ExpectSet: [CollectedSequence] :: forall step. [CollectedSet step] -> CollectedSet step
- Test.HMock.Internal.ExpectSet: [CollectedStep] :: step -> CollectedSet step
+ Test.HMock.Internal.ExpectSet: [CollectedStep] :: forall step. step -> CollectedSet step
- Test.HMock.Internal.ExpectSet: [ExpectConsecutive] :: Multiplicity -> ExpectSet step -> ExpectSet step
+ Test.HMock.Internal.ExpectSet: [ExpectConsecutive] :: forall step. Multiplicity -> ExpectSet step -> ExpectSet step
- Test.HMock.Internal.ExpectSet: [ExpectEither] :: ExpectSet step -> ExpectSet step -> ExpectSet step
+ Test.HMock.Internal.ExpectSet: [ExpectEither] :: forall step. ExpectSet step -> ExpectSet step -> ExpectSet step
- Test.HMock.Internal.ExpectSet: [ExpectInterleave] :: ExpectSet step -> ExpectSet step -> ExpectSet step
+ Test.HMock.Internal.ExpectSet: [ExpectInterleave] :: forall step. ExpectSet step -> ExpectSet step -> ExpectSet step
- Test.HMock.Internal.ExpectSet: [ExpectMulti] :: Multiplicity -> ExpectSet step -> ExpectSet step
+ Test.HMock.Internal.ExpectSet: [ExpectMulti] :: forall step. Multiplicity -> ExpectSet step -> ExpectSet step
- Test.HMock.Internal.ExpectSet: [ExpectNothing] :: ExpectSet step
+ Test.HMock.Internal.ExpectSet: [ExpectNothing] :: forall step. ExpectSet step
- Test.HMock.Internal.ExpectSet: [ExpectSequence] :: ExpectSet step -> ExpectSet step -> ExpectSet step
+ Test.HMock.Internal.ExpectSet: [ExpectSequence] :: forall step. ExpectSet step -> ExpectSet step -> ExpectSet step
- Test.HMock.Internal.ExpectSet: [ExpectStep] :: step -> ExpectSet step
+ Test.HMock.Internal.ExpectSet: [ExpectStep] :: forall step. step -> ExpectSet step
- Test.HMock.Internal.Rule: [:=>] :: WholeMethodMatcher cls name m r -> [Action cls name m r -> MockT m r] -> Rule cls name m r
+ Test.HMock.Internal.Rule: [:=>] :: forall (cls :: (Type -> Type) -> Constraint) (name :: Symbol) (m :: Type -> Type) r. WholeMethodMatcher cls name m r -> [Action cls name m r -> MockT m r] -> Rule cls name m r
- Test.HMock.Internal.Rule: [JustMatcher] :: Matcher cls name m r -> WholeMethodMatcher cls name m r
+ Test.HMock.Internal.Rule: [JustMatcher] :: forall (cls :: (Type -> Type) -> Constraint) (name :: Symbol) (m :: Type -> Type) r. Matcher cls name m r -> WholeMethodMatcher cls name m r
- Test.HMock.Internal.Rule: [SuchThat] :: Matcher cls name m r -> (Action cls name m r -> Bool) -> WholeMethodMatcher cls name m r
+ Test.HMock.Internal.Rule: [SuchThat] :: forall (cls :: (Type -> Type) -> Constraint) (name :: Symbol) (m :: Type -> Type) r. Matcher cls name m r -> (Action cls name m r -> Bool) -> WholeMethodMatcher cls name m r
- Test.HMock.Internal.Rule: data Rule (cls :: (Type -> Type) -> Constraint) (name :: Symbol) (m :: Type -> Type) (r :: Type)
+ Test.HMock.Internal.Rule: data Rule (cls :: Type -> Type -> Constraint) (name :: Symbol) (m :: Type -> Type) r
- Test.HMock.Internal.Rule: data WholeMethodMatcher cls name m r
+ Test.HMock.Internal.Rule: data WholeMethodMatcher (cls :: Type -> Type -> Constraint) (name :: Symbol) (m :: Type -> Type) r
- Test.HMock.Internal.Rule: showWholeMatcher :: MockableBase cls => Maybe (Action cls name m a) -> WholeMethodMatcher cls name m b -> String
+ Test.HMock.Internal.Rule: showWholeMatcher :: forall (cls :: (Type -> Type) -> Constraint) (name :: Symbol) (m :: Type -> Type) a b. MockableBase cls => Maybe (Action cls name m a) -> WholeMethodMatcher cls name m b -> String
- Test.HMock.Internal.State: MockState :: TVar (ExpectSet (Step m)) -> TVar [Step m] -> TVar [Step m] -> TVar [Step m] -> TVar Severity -> TVar Severity -> TVar Severity -> TVar Severity -> TVar (Set TypeRep) -> TVar (Set (TypeRep, String)) -> Maybe (MockState m) -> MockState m
+ Test.HMock.Internal.State: MockState :: TVar (ExpectSet (Step m)) -> TVar [Step m] -> TVar [Step m] -> TVar [Step m] -> TVar Severity -> TVar Severity -> TVar Severity -> TVar Severity -> TVar (Set TypeRep) -> TVar (Set (TypeRep, String)) -> Maybe (MockState m) -> MockState (m :: Type -> Type)
- Test.HMock.Internal.State: [MockSetup] :: ReaderT (MockState m) STM a -> MockSetup m a
+ Test.HMock.Internal.State: [MockSetup] :: forall (m :: Type -> Type) a. ReaderT (MockState m) STM a -> MockSetup m a
- Test.HMock.Internal.State: [MockT] :: ReaderT (MockState m) m a -> MockT m a
+ Test.HMock.Internal.State: [MockT] :: forall (m :: Type -> Type) a. ReaderT (MockState m) m a -> MockT m a
- Test.HMock.Internal.State: [mockAllowUnexpected] :: MockState m -> TVar [Step m]
+ Test.HMock.Internal.State: [mockAllowUnexpected] :: MockState (m :: Type -> Type) -> TVar [Step m]
- Test.HMock.Internal.State: [mockAmbiguitySeverity] :: MockState m -> TVar Severity
+ Test.HMock.Internal.State: [mockAmbiguitySeverity] :: MockState (m :: Type -> Type) -> TVar Severity
- Test.HMock.Internal.State: [mockClasses] :: MockState m -> TVar (Set TypeRep)
+ Test.HMock.Internal.State: [mockClasses] :: MockState (m :: Type -> Type) -> TVar (Set TypeRep)
- Test.HMock.Internal.State: [mockDefaults] :: MockState m -> TVar [Step m]
+ Test.HMock.Internal.State: [mockDefaults] :: MockState (m :: Type -> Type) -> TVar [Step m]
- Test.HMock.Internal.State: [mockExpectSet] :: MockState m -> TVar (ExpectSet (Step m))
+ Test.HMock.Internal.State: [mockExpectSet] :: MockState (m :: Type -> Type) -> TVar (ExpectSet (Step m))
- Test.HMock.Internal.State: [mockInterestingMethods] :: MockState m -> TVar (Set (TypeRep, String))
+ Test.HMock.Internal.State: [mockInterestingMethods] :: MockState (m :: Type -> Type) -> TVar (Set (TypeRep, String))
- Test.HMock.Internal.State: [mockParent] :: MockState m -> Maybe (MockState m)
+ Test.HMock.Internal.State: [mockParent] :: MockState (m :: Type -> Type) -> Maybe (MockState m)
- Test.HMock.Internal.State: [mockSideEffects] :: MockState m -> TVar [Step m]
+ Test.HMock.Internal.State: [mockSideEffects] :: MockState (m :: Type -> Type) -> TVar [Step m]
- Test.HMock.Internal.State: [mockUnexpectedSeverity] :: MockState m -> TVar Severity
+ Test.HMock.Internal.State: [mockUnexpectedSeverity] :: MockState (m :: Type -> Type) -> TVar Severity
- Test.HMock.Internal.State: [mockUninterestingSeverity] :: MockState m -> TVar Severity
+ Test.HMock.Internal.State: [mockUninterestingSeverity] :: MockState (m :: Type -> Type) -> TVar Severity
- Test.HMock.Internal.State: [mockUnmetSeverity] :: MockState m -> TVar Severity
+ Test.HMock.Internal.State: [mockUnmetSeverity] :: MockState (m :: Type -> Type) -> TVar Severity
- Test.HMock.Internal.State: allStates :: MockState m -> [MockState m]
+ Test.HMock.Internal.State: allStates :: forall (m :: Type -> Type). MockState m -> [MockState m]
- Test.HMock.Internal.State: class MockContext ctx
+ Test.HMock.Internal.State: class MockContext (ctx :: Type -> Type -> Type -> Type)
- Test.HMock.Internal.State: data MockState m
+ Test.HMock.Internal.State: data MockState (m :: Type -> Type)
- Test.HMock.Internal.State: expectThisSet :: MonadIO m => ExpectSet (Step m) -> MockSetup m ()
+ Test.HMock.Internal.State: expectThisSet :: forall (m :: Type -> Type). MonadIO m => ExpectSet (Step m) -> MockSetup m ()
- Test.HMock.Internal.State: fromMockSetup :: (MockContext ctx, MonadIO m) => MockSetup m a -> ctx m a
+ Test.HMock.Internal.State: fromMockSetup :: forall (m :: Type -> Type) a. (MockContext ctx, MonadIO m) => MockSetup m a -> ctx m a
- Test.HMock.Internal.State: initClassIfNeeded :: forall cls m proxy. (Mockable cls, Typeable m, MonadIO m) => proxy cls -> MockSetup m ()
+ Test.HMock.Internal.State: initClassIfNeeded :: forall (cls :: (Type -> Type) -> Constraint) (m :: Type -> Type) proxy. (Mockable cls, Typeable m, MonadIO m) => proxy cls -> MockSetup m ()
- Test.HMock.Internal.State: initClassesAsNeeded :: MonadIO m => ExpectSet (Step m) -> MockSetup m ()
+ Test.HMock.Internal.State: initClassesAsNeeded :: forall (m :: Type -> Type). MonadIO m => ExpectSet (Step m) -> MockSetup m ()
- Test.HMock.Internal.State: isInteresting :: forall (cls :: (Type -> Type) -> Constraint) name m proxy1 proxy2. (Typeable cls, KnownSymbol name) => proxy1 cls -> proxy2 name -> MockSetup m Bool
+ Test.HMock.Internal.State: isInteresting :: forall (cls :: (Type -> Type) -> Constraint) (name :: Symbol) (m :: Type -> Type) proxy1 proxy2. (Typeable cls, KnownSymbol name) => proxy1 cls -> proxy2 name -> MockSetup m Bool
- Test.HMock.Internal.State: markInteresting :: forall (cls :: (Type -> Type) -> Constraint) name m proxy1 proxy2. (Typeable cls, KnownSymbol name) => proxy1 cls -> proxy2 name -> MockSetup m ()
+ Test.HMock.Internal.State: markInteresting :: forall (cls :: (Type -> Type) -> Constraint) (name :: Symbol) (m :: Type -> Type) proxy1 proxy2. (Typeable cls, KnownSymbol name) => proxy1 cls -> proxy2 name -> MockSetup m ()
- Test.HMock.Internal.State: mockSetupSTM :: STM a -> MockSetup m a
+ Test.HMock.Internal.State: mockSetupSTM :: forall a (m :: Type -> Type). STM a -> MockSetup m a
- Test.HMock.Internal.State: newtype MockSetup m a
+ Test.HMock.Internal.State: newtype MockSetup (m :: Type -> Type) a
- Test.HMock.Internal.State: newtype MockT m a
+ Test.HMock.Internal.State: newtype MockT (m :: Type -> Type) a
- Test.HMock.Internal.State: reportFault :: (HasCallStack, MonadIO m) => Severity -> String -> MockT m ()
+ Test.HMock.Internal.State: reportFault :: forall (m :: Type -> Type). (HasCallStack, MonadIO m) => Severity -> String -> MockT m ()
- Test.HMock.Internal.State: rootState :: MockState m -> MockState m
+ Test.HMock.Internal.State: rootState :: forall (m :: Type -> Type). MockState m -> MockState m
- Test.HMock.Internal.State: runInRootState :: MockSetup m a -> MockSetup m a
+ Test.HMock.Internal.State: runInRootState :: forall (m :: Type -> Type) a. MockSetup m a -> MockSetup m a
- Test.HMock.Internal.Step: Expected :: ExpectSet (Step m) -> Expected m a
+ Test.HMock.Internal.Step: Expected :: ExpectSet (Step m) -> Expected (m :: Type -> Type) a
- Test.HMock.Internal.Step: [:->] :: WholeMethodMatcher cls name m r -> Maybe (Action cls name m r -> MockT m r) -> SingleRule cls name m r
+ Test.HMock.Internal.Step: [:->] :: forall (cls :: (Type -> Type) -> Constraint) (name :: Symbol) (m :: Type -> Type) r. WholeMethodMatcher cls name m r -> Maybe (Action cls name m r -> MockT m r) -> SingleRule cls name m r
- Test.HMock.Internal.Step: [Step] :: MockableMethod cls name m r => Located (SingleRule cls name m r) -> Step m
+ Test.HMock.Internal.Step: [Step] :: forall (cls :: (Type -> Type) -> Constraint) (name :: Symbol) (m :: Type -> Type) r. MockableMethod cls name m r => Located (SingleRule cls name m r) -> Step m
- Test.HMock.Internal.Step: [unwrapExpected] :: Expected m a -> ExpectSet (Step m)
+ Test.HMock.Internal.Step: [unwrapExpected] :: Expected (m :: Type -> Type) a -> ExpectSet (Step m)
- Test.HMock.Internal.Step: data SingleRule (cls :: (Type -> Type) -> Constraint) (name :: Symbol) (m :: Type -> Type) (r :: Type)
+ Test.HMock.Internal.Step: data SingleRule (cls :: Type -> Type -> Constraint) (name :: Symbol) (m :: Type -> Type) r
- Test.HMock.Internal.Step: data Step m
+ Test.HMock.Internal.Step: data Step (m :: Type -> Type)
- Test.HMock.Internal.Step: expandRepeatRule :: MockableMethod cls name m r => Multiplicity -> CallStack -> Rule cls name m r -> ExpectSet (Step m)
+ Test.HMock.Internal.Step: expandRepeatRule :: forall (cls :: (Type -> Type) -> Constraint) (name :: Symbol) (m :: Type -> Type) r. MockableMethod cls name m r => Multiplicity -> CallStack -> Rule cls name m r -> ExpectSet (Step m)
- Test.HMock.Internal.Step: expandRule :: MockableMethod cls name m r => CallStack -> Rule cls name m r -> ExpectSet (Step m)
+ Test.HMock.Internal.Step: expandRule :: forall (cls :: (Type -> Type) -> Constraint) (name :: Symbol) (m :: Type -> Type) r. MockableMethod cls name m r => CallStack -> Rule cls name m r -> ExpectSet (Step m)
- Test.HMock.Internal.Step: newtype Expected m a
+ Test.HMock.Internal.Step: newtype Expected (m :: Type -> Type) a
- Test.HMock.MockMethod: mockDefaultlessMethod :: (HasCallStack, MonadIO m, MockableMethod cls name m r) => Action cls name m r -> MockT m r
+ Test.HMock.MockMethod: mockDefaultlessMethod :: forall (m :: Type -> Type) (cls :: (Type -> Type) -> Constraint) (name :: Symbol) r. (HasCallStack, MonadIO m, MockableMethod cls name m r) => Action cls name m r -> MockT m r
- Test.HMock.MockMethod: mockMethod :: (HasCallStack, MonadIO m, MockableMethod cls name m r, Default r) => Action cls name m r -> MockT m r
+ Test.HMock.MockMethod: mockMethod :: forall (m :: Type -> Type) (cls :: (Type -> Type) -> Constraint) (name :: Symbol) r. (HasCallStack, MonadIO m, MockableMethod cls name m r, Default r) => Action cls name m r -> MockT m r
- Test.HMock.MockT: allowUnexpected :: forall cls name m r rule ctx. (MonadIO m, MockableMethod cls name m r, Expectable cls name m r rule, MockContext ctx) => rule -> ctx m ()
+ Test.HMock.MockT: allowUnexpected :: forall (cls :: (Type -> Type) -> Constraint) (name :: Symbol) (m :: Type -> Type) r rule ctx. (MonadIO m, MockableMethod cls name m r, Expectable cls name m r rule, MockContext ctx) => rule -> ctx m ()
- Test.HMock.MockT: byDefault :: forall cls name m r ctx. (MonadIO m, MockableMethod cls name m r, MockContext ctx) => Rule cls name m r -> ctx m ()
+ Test.HMock.MockT: byDefault :: forall (cls :: (Type -> Type) -> Constraint) (name :: Symbol) (m :: Type -> Type) r ctx. (MonadIO m, MockableMethod cls name m r, MockContext ctx) => Rule cls name m r -> ctx m ()
- Test.HMock.MockT: class MockContext ctx
+ Test.HMock.MockT: class MockContext (ctx :: Type -> Type -> Type -> Type)
- Test.HMock.MockT: data MockSetup m a
+ Test.HMock.MockT: data MockSetup (m :: Type -> Type) a
- Test.HMock.MockT: data MockT m a
+ Test.HMock.MockT: data MockT (m :: Type -> Type) a
- Test.HMock.MockT: describeExpectations :: MonadIO m => MockT m String
+ Test.HMock.MockT: describeExpectations :: forall (m :: Type -> Type). MonadIO m => MockT m String
- Test.HMock.MockT: nestMockT :: forall m a. MonadIO m => MockT m a -> MockT m a
+ Test.HMock.MockT: nestMockT :: forall (m :: Type -> Type) a. MonadIO m => MockT m a -> MockT m a
- Test.HMock.MockT: runMockT :: forall m a. MonadIO m => MockT m a -> m a
+ Test.HMock.MockT: runMockT :: MonadIO m => MockT m a -> m a
- Test.HMock.MockT: setAmbiguityCheck :: MonadIO m => Severity -> MockT m ()
+ Test.HMock.MockT: setAmbiguityCheck :: forall (m :: Type -> Type). MonadIO m => Severity -> MockT m ()
- Test.HMock.MockT: setUnexpectedActionCheck :: MonadIO m => Severity -> MockT m ()
+ Test.HMock.MockT: setUnexpectedActionCheck :: forall (m :: Type -> Type). MonadIO m => Severity -> MockT m ()
- Test.HMock.MockT: setUninterestingActionCheck :: MonadIO m => Severity -> MockT m ()
+ Test.HMock.MockT: setUninterestingActionCheck :: forall (m :: Type -> Type). MonadIO m => Severity -> MockT m ()
- Test.HMock.MockT: setUnmetExpectationCheck :: MonadIO m => Severity -> MockT m ()
+ Test.HMock.MockT: setUnmetExpectationCheck :: forall (m :: Type -> Type). MonadIO m => Severity -> MockT m ()
- Test.HMock.MockT: verifyExpectations :: MonadIO m => MockT m ()
+ Test.HMock.MockT: verifyExpectations :: forall (m :: Type -> Type). MonadIO m => MockT m ()
- Test.HMock.MockT: whenever :: forall cls name m r ctx. (MonadIO m, MockableMethod cls name m r, MockContext ctx) => Rule cls name m r -> ctx m ()
+ Test.HMock.MockT: whenever :: forall (cls :: (Type -> Type) -> Constraint) (name :: Symbol) (m :: Type -> Type) r ctx. (MonadIO m, MockableMethod cls name m r, MockContext ctx) => Rule cls name m r -> ctx m ()
- Test.HMock.MockT: withMockT :: forall m b. MonadIO m => ((forall a. MockT m a -> m a) -> MockT m b) -> m b
+ Test.HMock.MockT: withMockT :: MonadIO m => ((forall a. () => MockT m a -> m a) -> MockT m b) -> m b
- Test.HMock.MockT: withNestedMockT :: forall m b. MonadIO m => ((forall a. MockT m a -> m a) -> MockT m b) -> MockT m b
+ Test.HMock.MockT: withNestedMockT :: MonadIO m => ((forall a. () => MockT m a -> m a) -> MockT m b) -> MockT m b
- Test.HMock.Mockable: class MockableBase cls => Mockable (cls :: (Type -> Type) -> Constraint)
+ Test.HMock.Mockable: class MockableBase cls => Mockable (cls :: Type -> Type -> Constraint)
- Test.HMock.Mockable: class (Typeable cls) => MockableBase (cls :: (Type -> Type) -> Constraint) where {
+ Test.HMock.Mockable: class Typeable cls => MockableBase (cls :: Type -> Type -> Constraint) where {
- Test.HMock.Mockable: data Action cls :: Symbol -> (Type -> Type) -> Type -> Type;
+ Test.HMock.Mockable: data Action (cls :: Type -> Type -> Constraint) :: Symbol -> Type -> Type -> Type -> Type;
- Test.HMock.Mockable: data Matcher cls :: Symbol -> (Type -> Type) -> Type -> Type;
+ Test.HMock.Mockable: data Matcher (cls :: Type -> Type -> Constraint) :: Symbol -> Type -> Type -> Type -> Type;
- Test.HMock.Mockable: matchAction :: MockableBase cls => Matcher cls name m a -> Action cls name m a -> MatchResult
+ Test.HMock.Mockable: matchAction :: forall (name :: Symbol) (m :: Type -> Type) a. MockableBase cls => Matcher cls name m a -> Action cls name m a -> MatchResult
- Test.HMock.Mockable: setupMockable :: (Mockable cls, MonadIO m, Typeable m) => proxy cls -> MockSetup m ()
+ Test.HMock.Mockable: setupMockable :: forall (m :: Type -> Type) proxy. (Mockable cls, MonadIO m, Typeable m) => proxy cls -> MockSetup m ()
- Test.HMock.Mockable: showAction :: MockableBase cls => Action cls name m a -> String
+ Test.HMock.Mockable: showAction :: forall (name :: Symbol) (m :: Type -> Type) a. MockableBase cls => Action cls name m a -> String
- Test.HMock.Mockable: showMatcher :: MockableBase cls => Maybe (Action cls name m a) -> Matcher cls name m b -> String
+ Test.HMock.Mockable: showMatcher :: forall (name :: Symbol) (m :: Type -> Type) a b. MockableBase cls => Maybe (Action cls name m a) -> Matcher cls name m b -> String
- Test.HMock.Rule: (|->) :: (Monad m, Expectable cls name m r ex) => ex -> r -> Rule cls name m r
+ Test.HMock.Rule: (|->) :: forall (m :: Type -> Type) (cls :: (Type -> Type) -> Constraint) (name :: Symbol) r ex. (Monad m, Expectable cls name m r ex) => ex -> r -> Rule cls name m r
- Test.HMock.Rule: (|=>) :: Expectable cls name m r ex => ex -> (Action cls name m r -> MockT m r) -> Rule cls name m r
+ Test.HMock.Rule: (|=>) :: forall (cls :: (Type -> Type) -> Constraint) (name :: Symbol) (m :: Type -> Type) r ex. Expectable cls name m r ex => ex -> (Action cls name m r -> MockT m r) -> Rule cls name m r
- Test.HMock.Rule: [SuchThat] :: Matcher cls name m r -> (Action cls name m r -> Bool) -> WholeMethodMatcher cls name m r
+ Test.HMock.Rule: [SuchThat] :: forall (cls :: (Type -> Type) -> Constraint) (name :: Symbol) (m :: Type -> Type) r. Matcher cls name m r -> (Action cls name m r -> Bool) -> WholeMethodMatcher cls name m r
- Test.HMock.Rule: class Expectable cls name m r ex | ex -> cls name m r
+ Test.HMock.Rule: class Expectable (cls :: Type -> Type -> Constraint) (name :: Symbol) (m :: Type -> Type) r ex | ex -> cls name m r
- Test.HMock.Rule: data Rule (cls :: (Type -> Type) -> Constraint) (name :: Symbol) (m :: Type -> Type) (r :: Type)
+ Test.HMock.Rule: data Rule (cls :: Type -> Type -> Constraint) (name :: Symbol) (m :: Type -> Type) r
- Test.HMock.Rule: data WholeMethodMatcher cls name m r
+ Test.HMock.Rule: data WholeMethodMatcher (cls :: Type -> Type -> Constraint) (name :: Symbol) (m :: Type -> Type) r

Files

CHANGELOG.md view
@@ -1,5 +1,13 @@ # Revision history for hmock +## 0.5.2.0 -- 2026-09-01++* Supported GHC versions are now 9.0 through 9.14.+  * Support for GHC 8.6, 8.8, and 8.10 has been dropped.+* Version bounds now allow GHC 9.10, 9.12, and 9.14.+* Bumped dependency version upper bounds.+* Removed unused dependencies on `constraints` and `monad-control`.+ ## 0.5.1.2 -- 2023-11-28  * Version bounds now allow GHC 9.6 and 9.8
HMock.cabal view
@@ -1,6 +1,6 @@ cabal-version:      2.4 name:               HMock-version:            0.5.1.2+version:            0.5.2.0 synopsis:           A flexible mock framework for testing effectful code. description:        HMock is a flexible mock framework for testing effectful                     code in Haskell.  Tests can set up expectations about@@ -19,13 +19,20 @@ author:             Chris Smith <cdsmith@gmail.com> maintainer:         Chris Smith <cdsmith@gmail.com> -extra-source-files: CHANGELOG.md, README.md+extra-doc-files:    CHANGELOG.md, README.md -tested-with:        GHC == 8.6.5 || == 8.8.4 || == 8.10.7 || == 9.0.2 || == 9.2.8 || == 9.4.5 || == 9.6.2 || == 9.8.1+tested-with:        GHC == 9.0.2+                     || == 9.2.8+                     || == 9.4.8+                     || == 9.6.7+                     || == 9.8.4+                     || == 9.10.3+                     || == 9.12.4+                     || == 9.14.1  source-repository head     type:     git-    location: git://github.com/cdsmith/HMock.git+    location: https://github.com/cdsmith/HMock.git  library     exposed-modules:  Test.HMock,@@ -42,18 +49,16 @@                       Test.HMock.Internal.Step,                       Test.HMock.Internal.TH,                       Test.HMock.Internal.Util-    build-depends:    base >=4.11.0 && < 4.20,-                      constraints >= 0.13 && < 0.15,-                      containers >= 0.6.2 && < 0.8,-                      data-default >= 0.7.1 && < 0.8,+    build-depends:    base >= 4.15.0 && < 4.23,+                      containers >= 0.6.2 && < 0.9,+                      data-default >= 0.7.1 && < 0.9,                       exceptions >= 0.10.4 && < 0.11,                       explainable-predicates >= 0.1 && < 0.2,-                      extra >= 1.7.9 && < 1.8,-                      monad-control >= 1.0.2 && < 1.1,+                      extra >= 1.7.9 && < 1.9,                       mtl >= 2.2.2 && < 2.4,                       stm >= 2.5.0 && < 2.6,                       syb >= 0.7.2 && < 0.8,-                      template-haskell >= 2.14 && < 2.22,+                      template-haskell >= 2.17 && < 2.25,                       transformers-base >= 0.4.5 && < 0.5,                       unliftio >= 0.2.18 && < 0.3,     hs-source-dirs:   src@@ -77,10 +82,8 @@     build-depends:    HMock,                       QuickCheck,                       base,-                      containers,                       data-default,                       deepseq,-                      directory,                       doctest-exitcode-stdio,                       doctest-lib,                       exceptions,
README.md view
@@ -620,7 +620,7 @@  ### Which GHC versions are supported? -HMock is tested with GHC versions from 8.6 through 9.4.+HMock is tested with GHC versions from 9.0 through 9.14.  ## Case Study: Mocking Template Haskell 
src/Test/HMock/Internal/State.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}@@ -36,7 +35,7 @@ import Test.HMock.Mockable (Mockable (..)) import UnliftIO   ( MonadIO,-    MonadUnliftIO(withRunInIO),+    MonadUnliftIO,     STM,     TVar,     atomically,@@ -47,10 +46,6 @@   ) import Data.Kind (Type, Constraint) -#if !MIN_VERSION_base(4, 13, 0)-import Control.Monad.Fail (MonadFail)-#endif- -- | The severity for a possible problem. data Severity   = -- | Fail the test.@@ -198,16 +193,12 @@       MonadBase b,       MonadCatch,       MonadMask,-      MonadThrow+      MonadThrow,+      MonadUnliftIO     )  instance MonadTrans MockT where   lift = MockT . lift---- Note: The 'MonadUnliftIO' instance is implemented manually because deriving--- it causes compilation failure in GHC 8.6 and 8.8.  (See issue #23.)-instance MonadUnliftIO m => MonadUnliftIO (MockT m) where-  withRunInIO inner = MockT $ withRunInIO $ \run -> inner (run . unMockT)  -- | Applies a function to the base monad of 'MockT'. mapMockT :: (m a -> m b) -> MockT m a -> MockT m b
src/Test/HMock/Internal/TH.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE TupleSections #-} @@ -32,8 +31,6 @@ import Language.Haskell.TH.Syntax (NameFlavour (..)) import Test.HMock.Internal.Util (choices) -#if MIN_VERSION_template_haskell(2,17,0)- -- | Fetches the 'Name' of a 'TyVarBndr'. tvName :: TyVarBndr flag -> Name tvName (PlainTV name _) = name@@ -42,19 +39,6 @@ -- | Creates a 'TyVarBndr' for a plain variable without a kind annotation. bindVar :: Name -> TyVarBndr Specificity bindVar n = PlainTV n SpecifiedSpec--#else---- | Fetches the 'Name' of a 'TyVarBndr'.-tvName :: TyVarBndr -> Name-tvName (PlainTV name) = name-tvName (KindedTV name _) = name---- | Creates a 'TyVarBndr' for a plain variable without a kind annotation.-bindVar :: Name -> TyVarBndr-bindVar = PlainTV--#endif  -- | Gets the unapplied top-level name from a type application. unappliedName :: Type -> Maybe Name
src/Test/HMock/MockMethod.hs view
@@ -71,7 +71,8 @@ mockMethodImpl surrogate action = join $   fromMockSetup $ do     initClassIfNeeded (Proxy :: Proxy cls)-    states <- allStates <$> MockSetup ask+    currentState <- MockSetup ask+    let states = allStates currentState     (partial, full) <- fmap (bimap concat concat . unzip) $       forM states $ \state -> do         expectSet <- mockSetupSTM $ readTVar (mockExpectSet state)@@ -87,10 +88,10 @@     sideEffect <-       getSideEffect         <$> concatMapM (mockSetupSTM . readTVar . mockSideEffects) states-    ambigSev <- mockSetupSTM $ readTVar . mockAmbiguitySeverity . head $ states+    ambigSev <- mockSetupSTM $ readTVar (mockAmbiguitySeverity currentState)     unintSev <--      mockSetupSTM $ readTVar . mockUninterestingSeverity . head $ states-    unexpSev <- mockSetupSTM $ readTVar . mockUnexpectedSeverity . head $ states+      mockSetupSTM $ readTVar (mockUninterestingSeverity currentState)+    unexpSev <- mockSetupSTM $ readTVar (mockUnexpectedSeverity currentState)     case ( full,            orderedPartial,            allowedUnexpected unexpected,
src/Test/HMock/MockT.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}
src/Test/HMock/TH.hs view
@@ -26,7 +26,10 @@ import Data.Default (Default (..)) import Data.Either (partitionEithers) import qualified Data.Kind-import Data.List (foldl', (\\))+import Data.List ((\\))+#if !MIN_VERSION_base(4, 20, 0)+import Data.List (foldl')+#endif import Data.Maybe (catMaybes, isNothing) import Data.Proxy (Proxy) import Data.Typeable (Typeable, typeRep)
test/Classes.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE DeriveAnyClass #-}@@ -33,10 +32,8 @@ import Test.Predicates (anything, eq, hasSubstr, qMatch, with) import Util.DeriveRecursive (deriveRecursive) -#if MIN_VERSION_template_haskell(2, 16, 0) -- Pre-define low-level instance to prevent deriveRecursive from trying. instance NFData Bytes where rnf = undefined-#endif  deriveRecursive (Just AnyclassStrategy) ''NFData ''Dec @@ -823,7 +820,7 @@             expect $               QReport_                 anything-                (hasSubstr "Expected GHC.Types.Int to be a class")+                (hasSubstr "Int to be a class")              _ <- runQ (makeMockable [t|Int|])             return ()
test/ExpectSet.hs view
@@ -1,10 +1,13 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ScopedTypeVariables #-}  module ExpectSet where  import Control.Arrow (second)+#if !MIN_VERSION_base(4, 20, 0) import Data.List (foldl')+#endif import Test.HMock.Internal.ExpectSet import Test.HMock.Multiplicity import Test.Hspec
test/QuasiMock.hs view
@@ -12,10 +12,6 @@ import Test.HMock import Test.Predicates (anything, elemsAre, eq, is, qMatch) -#if !MIN_VERSION_base(4, 13, 0)-import Control.Monad.Fail (MonadFail)-#endif- -- Because not all methods of Quasi are mockable, the instance must be written -- by hand. instance (Typeable m, MonadFail m, MonadIO m) => Quasi (MockT m) where@@ -39,9 +35,7 @@   qAddTempFile s = mockMethod (QAddTempFile s)   qAddForeignFilePath l s = mockMethod (QAddForeignFilePath l s) -#if MIN_VERSION_template_haskell(2, 16, 0)   qReifyType n = mockDefaultlessMethod (QReifyType n)-#endif  #if MIN_VERSION_template_haskell(2, 19, 0)   qGetPackageRoot = mockDefaultlessMethod QGetPackageRoot
test/QuasiMockBase.hs view
@@ -19,8 +19,9 @@ import Test.HMock (MakeMockableOptions (..), makeMockableWithOptions) import Util.DeriveRecursive (deriveRecursive) -#if MIN_VERSION_template_haskell(2, 16, 0)+#if !MIN_VERSION_template_haskell(2, 23, 0) -- Pre-define low-level instance to prevent deriveRecursive from trying.+-- template-haskell 2.23 (GHC 9.12) provides this instance itself. instance Lift Bytes where lift = undefined; liftTyped = undefined #endif 
test/Util/DeriveRecursive.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} module Util.DeriveRecursive where  import Control.Monad (replicateM)@@ -5,7 +6,9 @@ import Control.Monad.State (StateT, evalStateT, gets, modify) import Control.Monad.Trans (MonadTrans (lift)) import Language.Haskell.TH+#if !MIN_VERSION_base(4, 20, 0) import Data.List (foldl')+#endif  deriveRecursive :: Maybe DerivStrategy -> Name -> Name -> Q [Dec] deriveRecursive strat cls ty = evalStateT (concatMapM defineIfNeeded [ty]) []