Current section

Files

Jump to
spek CHANGELOG.md
Raw

CHANGELOG.md

# Changelog
All notable changes to this project are documented in this file.
The format is based on
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
- Add the complement laws to `Spek.optimize/1`.
- Support guards in `Spek.Macros.defcheck/2`.
- Add `Spek.to_boolean/1` to the public API.
### Changed
- Deduplicate the results returned by `Spek.collect_results/1` and
`Spek.collect_results/2`.
- Apply the transformations of `Spek.optimize/1` repeatedly until no further
optimization applies.
- Keep the result of a literal when `Spek.optimize/1` negates it.
- Raise an `ArgumentError` naming the check function if a check returns an
invalid result.
- Raise an `ArgumentError` for an invalid `{:ctx, key}` check argument.
- Raise an `ArgumentError` in `Spek.literal/1` for an invalid result.
- Raise an `ArgumentError` in `Spek.pass/1` for a falsy result and in
`Spek.fail/1` for a truthy one.
- Raise an `ArgumentError` at compile time in `Spek.Macros.defcheck/2` if the
`:args` option does not match the check function arity.
- Generate the `{name}_check/1` function without a default argument in
`Spek.Macros.defcheck/2` if the check function always takes two or more
arguments.
### Fixed
- Collect tagged results within `Not` expressions in `Spek.collect_results/1`.
- Accept options for a check without arguments in `Spek.Macros.defcheck/2`.
- Accept `_` and struct patterns as `Spek.Macros.defcheck/2` arguments.
- Fix the type specs of the `_check` functions generated by
`Spek.Macros.build_check/2` and `Spek.Macros.defcheck/2`.
- Add the missing type specs for `Spek.EvaluationError.new/0` and
`Spek.EvaluationError.with_expression/1`.
- Stop emitting unused variable warnings for a `Spek.Macros.defcheck/2`
do-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 the
`Spek.Macros.defcheck/2` do-block.
### Fixed
- Handle `Spek.Macros.defcheck/2` calls 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/1` and `Spek.collect_results/2`.
- Add `Spek.eval_collect/2`, `Spek.eval_collect!/2`, `Spek.eval_collect_all/2`
and `Spek.eval_collect_all!/2`.
- Add `Spek.EvaluationError.put_results/1`.
- Add the `results` field to the `Spek.EvaluationError` struct.
## [0.1.2] - 2026-05-18
### Changed
- Improve the documentation.
## [0.1.1] - 2026-05-17
### Fixed
- Allow calling `Spek.Macros.defcheck/2` without arguments.
- Fix the type specification for the `fun` field of `t:Spek.Check.t()`.
## [0.1.0] - 2026-05-17
Initial release.
[unreleased]: https://github.com/woylie/spek/compare/0.3.1...HEAD
[0.3.1]: https://github.com/woylie/spek/compare/0.3.0...0.3.1
[0.3.0]: https://github.com/woylie/spek/compare/0.2.0...0.3.0
[0.2.0]: https://github.com/woylie/spek/compare/0.1.2...0.2.0
[0.1.2]: https://github.com/woylie/spek/compare/0.1.1...0.1.2
[0.1.1]: https://github.com/woylie/spek/compare/0.1.0...0.1.1
[0.1.0]: https://github.com/woylie/spek/releases/tag/0.1.0