Changelog for mockcat-1.0.0.0
Changelog for mockcat
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to the Haskell Package Versioning Policy.
[1.0.0.0] - 2025-12-24
Changed
- DSL Reboot: Replaced
|>with~>as the primary parameter chain operator (representing the "mock arrow"). - Terminology Shift: Standardized terminology to "called" instead of "applied" throughout the library and error messages.
- Simplified creating/stubbing API:
f <- mock $ ...is now the canonical way. - Expanded structural diffing support for nested records and lists.
- Unified verification API: All verification is now handled via
shouldBeCalled. - Strict by Default:
makeMockandmakePartialMocknow default to strict return values (implicit monadic return is disabled).makeAutoLiftMockwas introduced for the previous behavior.
Added
- Deep Structural Diff: Enhanced error messages with precise caret pointers for complex nested data structures.
- STM-based concurrency for mock registration and call recording.
- Infinite arity support for mock/stub building.
Removed
- Backward compatibility with 0.x.x APIs (
stubFn,createMock,applied, etc.). makeMockWithOptions,makePartialMockWithOptions, andMockOptions(internalized to simplify API).
Migration Guide (0.x -> 1.0)
This release is a complete reboot. Previous code will break.
-
Operator Change: Replace
|>with~>.-- Old createStubFn $ "arg" |> "result" -- New stub $ "arg" ~> "result" -
Mock Creation: Use
mock/stubinstead ofcreateMock/createStubFn.-- Old f <- createMock $ "arg" |> "result" -- New f <- mock $ "arg" ~> "result" -
Verification: Use
shouldBeCalled(unified API).-- Old f `shouldApplyTo` "arg" -- New f `shouldBeCalled` "arg" -
Template Haskell Generics:
makeMockis now strict by default (requires explicitpurefor IO actions).- Use
makeAutoLiftMockfor old implicit behavior. - Or stick to
makeMockand addpureto your return values.
- Use
0.6.0.0
Changed
- Removed the upper limit on variable arguments when creating stub functions. Previously, there was a restriction on the maximum number of arguments, but this limitation has been removed, allowing stub functions to accept an arbitrary number of arguments.
0.5.5.0
Added
- Aliases
expectApplyTimesandexpectNever(preferred names) for pre-run expectation declarations.
Documentation
- README (EN/JA) now recommends
expectApplyTimes/expectNeverover legacyapplyTimesIs/neverApply. - Clarified that
expectApplyTimes nis the canonical form;expectNeveris sugar forexpectApplyTimes 0.
Notes
- Legacy names remain exported for backward compatibility (no deprecation pragma yet). They may receive a soft deprecation notice in a future minor release after community feedback.
0.5.4.0
Added
- Parallel execution support (verified counting under concurrency, stress tests).
- Verification helpers:
applyTimesIs,neverApply.
Changed
- Refactored
MockTfromStateTtoReaderT (TVar [Definition])architecture. - Simplified Template Haskell generated constraints.
Fixed
- Race causing lost/double count in concurrent stub applications (strict
modifyTVar').
Removed
unsafePerformIOin TH-generated code.
Internal
- Introduced
MonadMockDefsabstraction.
0.5.3.0
Added
MonadUnliftIOinstance forMockT(initial groundwork for later parallel support).