1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-10 11:01:03 +01:00
nix/tests/functional/lang/eval-okay-equal-function-list-distinct-similar.nix
Robert Hensing 6fb5276e7b test: add tests for function equality behavior
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
2025-12-07 14:43:46 +01:00

3 lines
159 B
Nix

# Distinct but not identical functions in list compare as unequal
# See https://nix.dev/manual/nix/latest/language/operators#equality
[ (x: x) ] == [ (x: x) ]