1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-17 22:41:08 +01:00

tests: add error tests for builtins.genericClosure

Covers error conditions for:
- Invalid argument types (not an attrset)
- Missing required attributes (startSet, operator)
- Type mismatches (startSet/operator not correct type)
- Element validation (elements not attrsets, missing key attribute)
- Key comparison errors (incompatible types, uncomparable types)
- Operator return value validation (not a list)
This commit is contained in:
Robert Hensing 2025-11-06 20:42:50 +01:00
parent 34c77ffe38
commit ca787bc3e0
20 changed files with 141 additions and 0 deletions

View file

@ -0,0 +1,10 @@
error:
… while calling the 'genericClosure' builtin
at /pwd/lang/eval-fail-genericClosure-operator-not-function.nix:1:1:
1| builtins.genericClosure {
| ^
2| startSet = [ { key = 1; } ];
… while evaluating the 'operator' attribute passed as argument to builtins.genericClosure
error: expected a function but found a string: "not a function"