mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 16:33:15 +00:00
tests.pkgs-lib.formats: Detect when impossible input is fed
This commit is contained in:
parent
ef6d9dfd71
commit
dcca8f5be2
@ -9,7 +9,11 @@ let
|
||||
let
|
||||
formatSet = format args;
|
||||
config = formatSet.type.merge [] (imap1 (n: def: {
|
||||
value = def;
|
||||
# We check the input values, so that
|
||||
# - we don't write nonsensical tests that will impede progress
|
||||
# - the test author has a slightly more realistic view of the
|
||||
# final format during development.
|
||||
value = lib.throwIfNot (formatSet.type.check def) (builtins.trace def "definition does not pass the type's check function") def;
|
||||
file = "def${toString n}";
|
||||
}) [ def ]);
|
||||
in formatSet.generate "test-format-file" config;
|
||||
|
Loading…
Reference in New Issue
Block a user