Test Suite
Running tests
Section titled “Running tests”# Format codenix run github:vic/checkmate#fmt --override-input target .
# Run all testsnix flake check github:vic/checkmate --override-input target . -LTests use checkmate — each test defines flake.tests.<name> = { expr, expected }.
Test index
Section titled “Test index”Transpose
Section titled “Transpose”| Test | What it verifies |
|---|---|
transpose_swap.nix | { a.b.c = 1 } → { b.a.c = 1 } |
transpose_common.nix | Common children merge: { a.b, c.b } → { b.{a,c} } |
tranpose_flake_modules.nix | flake.aspects → flake.modules end-to-end |
Resolution & Dependencies
Section titled “Resolution & Dependencies”| Test | What it verifies |
|---|---|
aspect_dependencies.nix | includes resolves transitive deps per class |
aspect_chain.nix | aspect-chain grows correctly through resolution |
aspect_modules_resolved.nix | .modules.<class> matches .resolve { class } |
aspect_fixpoint.nix | Fixpoint: providers reference siblings and top-level |
Providers
Section titled “Providers”| Test | What it verifies |
|---|---|
aspect_provides.nix | provides / _ with context-aware providers |
aspect_parametric.nix | Curried provider in provides |
aspect_toplevel_parametric.nix | Curried top-level aspect |
Functor
Section titled “Functor”| Test | What it verifies |
|---|---|
aspect_default_provider_functor.nix | __functor override with parametric includes |
aspect_default_provider_override.nix | Functor replaces original config entirely |
Scopes & Standalone
Section titled “Scopes & Standalone”| Test | What it verifies |
|---|---|
without_flakes.nix | new-scope + lib.evalModules without flakes |
aspect_assignment.nix | Multiple scopes merge correctly |
default_empty.nix | Empty flake.aspects produces empty flake.modules |
Forward
Section titled “Forward”| Test | What it verifies |
|---|---|
forward.nix | Cross-class module forwarding |
Test harness
Section titled “Test harness”The test infrastructure (checkmate/modules/tests.nix) provides:
| Helper | Purpose |
|---|---|
mkFlake | Creates a flake evaluation with aspects + test options pre-wired |
evalMod | Evaluates a module with lib.evalModules and returns .config |
fooOpt | Standard test options: foo (str), bar (listOf str), baz (attrsOf str) |
transpose | Direct access to the transpose function |
new-scope | Direct access for standalone tests |
forward | Direct access to the forward function |