Fix Nixpkgs evaluation on Functions
Nix says that { f = x: x; } == { g = y: y; }. The rule says to ignore functions when comparing attribute sets or lists. This commit follows this rule. However, it is still true that: (x: x) /= (y: y) I have also added some tests that check for these cases. Fixes #323
This commit is contained in:
parent
4fffd51438
commit
39100fa19e
|
@ -219,7 +219,10 @@ isClosureNF _ = False
|
|||
|
||||
thunkEq :: MonadThunk (NValue m) (NThunk m) m
|
||||
=> NThunk m -> NThunk m -> m Bool
|
||||
thunkEq lt rt = force lt $ \lv -> force rt $ \rv -> valueEq lv rv
|
||||
thunkEq lt rt = force lt $ \lv -> force rt $ \rv ->
|
||||
case (lv, rv) of
|
||||
(NVClosure _ _, NVClosure _ _) -> pure True
|
||||
_ -> valueEq lv rv
|
||||
|
||||
-- | Checks whether two containers are equal, using the given item equality
|
||||
-- predicate. If there are any item slots that don't match between the two
|
||||
|
|
|
@ -277,6 +277,15 @@ case_fixed_points_attrsets =
|
|||
in fix f
|
||||
|]
|
||||
|
||||
case_function_equals1 =
|
||||
constantEqualText "true" "{f = x: x;} == {f = x: x;}"
|
||||
|
||||
case_function_equals2 =
|
||||
constantEqualText "true" "[(x: x)] == [(x: x)]"
|
||||
|
||||
case_function_equals3 =
|
||||
constantEqualText "false" "(x: x) == (x: x)"
|
||||
|
||||
-- jww (2018-05-02): This constantly changes!
|
||||
-- case_placeholder =
|
||||
-- constantEqualText
|
||||
|
|
Loading…
Reference in a new issue