Skip to content

Test Suite

Terminal window
# Format code
nix run github:vic/checkmate#fmt --override-input target .
# Run all tests
nix flake check github:vic/checkmate --override-input target . -L

Tests use checkmate — each test defines flake.tests.<name> = { expr, expected }.

TestWhat it verifies
transpose_swap.nix{ a.b.c = 1 }{ b.a.c = 1 }
transpose_common.nixCommon children merge: { a.b, c.b }{ b.{a,c} }
tranpose_flake_modules.nixflake.aspectsflake.modules end-to-end
TestWhat it verifies
aspect_dependencies.nixincludes resolves transitive deps per class
aspect_chain.nixaspect-chain grows correctly through resolution
aspect_modules_resolved.nix.modules.<class> matches .resolve { class }
aspect_fixpoint.nixFixpoint: providers reference siblings and top-level
TestWhat it verifies
aspect_provides.nixprovides / _ with context-aware providers
aspect_parametric.nixCurried provider in provides
aspect_toplevel_parametric.nixCurried top-level aspect
TestWhat it verifies
aspect_default_provider_functor.nix__functor override with parametric includes
aspect_default_provider_override.nixFunctor replaces original config entirely
TestWhat it verifies
without_flakes.nixnew-scope + lib.evalModules without flakes
aspect_assignment.nixMultiple scopes merge correctly
default_empty.nixEmpty flake.aspects produces empty flake.modules
TestWhat it verifies
forward.nixCross-class module forwarding

The test infrastructure (checkmate/modules/tests.nix) provides:

HelperPurpose
mkFlakeCreates a flake evaluation with aspects + test options pre-wired
evalModEvaluates a module with lib.evalModules and returns .config
fooOptStandard test options: foo (str), bar (listOf str), baz (attrsOf str)
transposeDirect access to the transpose function
new-scopeDirect access for standalone tests
forwardDirect access to the forward function
Contribute Community Sponsor