Skip to content

Commit

Permalink
[internal] add failing test for FrozenDict equality issue (pantsbuild…
Browse files Browse the repository at this point in the history
…#13389)

Add a failing test which shows that FrozenDict's do not compare equally with the same elements but different insertion orders.

[ci skip-rust]
  • Loading branch information
Tom Dyas authored Dec 4, 2021
1 parent e736686 commit 0bb6655
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/python/pants/util/frozendict_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ def test_eq() -> None:
assert fd1 != d1


@pytest.mark.xfail(reason="FrozenDict equality broken for different insertion orders.")
def test_eq_different_orders() -> None:
fd1 = FrozenDict({"a": 0, "b": 1})
fd2 = FrozenDict({"b": 1, "a": 0})
assert fd1 == fd2


def test_lt() -> None:
d = {"a": 0, "b": 1}
assert FrozenDict(d) < FrozenDict({"a": 1, "b": 2})
Expand Down

0 comments on commit 0bb6655

Please sign in to comment.