All notable changes to this project are documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased
0.5.0 - 2026-08-26
Added
- Apply the associativity laws in
Spek.optimize/1.
Changed
- Set the
:resultof theSpek.Literalstruct generated bySpek.Macros.defcheck/2to the result of the check function.
Fixed
- Allow the do-block of
Spek.Macros.defcheck/2to return an:okor:errortuple that references the check arguments. - Fix the type spec generated by
Spek.Macros.defcheck/2for a do-block that returns a literal. - Collect the
:reasonoption ofSpek.Macros.defcheck/2when the do-block returns a literal. - Don't flatten list results in
Spek.collect_results/1andSpek.collect_results/2.
0.4.0 - 2026-08-09
Added
- Add the complement laws to
Spek.optimize/1. - Support guards in
Spek.Macros.defcheck/2. - Add
Spek.to_boolean/1to the public API.
Changed
- Deduplicate the results returned by
Spek.collect_results/1andSpek.collect_results/2. - Apply the transformations of
Spek.optimize/1repeatedly until no further optimization applies. - Keep the result of a literal when
Spek.optimize/1negates it. - Raise an
ArgumentErrornaming the check function if a check returns an invalid result. - Raise an
ArgumentErrorfor an invalid{:ctx, key}check argument. - Raise an
ArgumentErrorinSpek.literal/1for an invalid result. - Raise an
ArgumentErrorinSpek.pass/1for a falsy result and inSpek.fail/1for a truthy one. - Raise an
ArgumentErrorat compile time inSpek.Macros.defcheck/2if the:argsoption does not match the check function arity. - Generate the
{name}_check/1function without a default argument inSpek.Macros.defcheck/2if the check function always takes two or more arguments.
Fixed
- Collect tagged results within
Notexpressions inSpek.collect_results/1. - Accept options for a check without arguments in
Spek.Macros.defcheck/2. - Accept
_and struct patterns asSpek.Macros.defcheck/2arguments. - Fix the type specs of the
_checkfunctions generated bySpek.Macros.build_check/2andSpek.Macros.defcheck/2. - Add the missing type specs for
Spek.EvaluationError.new/0andSpek.EvaluationError.with_expression/1. - Stop emitting unused variable warnings for a
Spek.Macros.defcheck/2do-block that returns a literal.
0.3.1 - 2026-06-05
Fixed
- Fix the type spec generated by
Spek.Macros.defcheck/2.
0.3.0 - 2026-06-05
Added
- Support returning
:ok,:error,{:ok, term}, or{:error, term}in theSpek.Macros.defcheck/2do-block.
Fixed
- Handle
Spek.Macros.defcheck/2calls with multiple arguments and no options. - Handle default arguments in
Spek.Macros.defcheck/2.
0.2.0 - 2026-05-20
Added
- Add
Spek.collect_results/1andSpek.collect_results/2. - Add
Spek.eval_collect/2,Spek.eval_collect!/2,Spek.eval_collect_all/2andSpek.eval_collect_all!/2. - Add
Spek.EvaluationError.put_results/1. - Add the
resultsfield to theSpek.EvaluationErrorstruct.
0.1.2 - 2026-05-18
Changed
- Improve the documentation.
0.1.1 - 2026-05-17
Fixed
- Allow calling
Spek.Macros.defcheck/2without arguments. - Fix the type specification for the
funfield oft:Spek.Check.t().
0.1.0 - 2026-05-17
Initial release.