mirror of
https://github.com/NixOS/nix.git
synced 2025-12-11 11:31:03 +01:00
Add tests for function equality covering both direct comparisons and comparisons within composite types (lists and attribute sets). Tests verify: - Direct function comparisons always return false - Value identity optimization in composite types allows identical functions to compare as equal when both references point to the same function value
6 lines
184 B
Nix
6 lines
184 B
Nix
# Function comparison in list uses value identity optimization
|
|
# See https://nix.dev/manual/nix/latest/language/operators#value-identity-optimization
|
|
let
|
|
f = x: x;
|
|
in
|
|
[ f ] == [ f ]
|