-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loosen diff behavior equality comparisons
- Loading branch information
Showing
5 changed files
with
56 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from crosshair.test_util import flexible_equal | ||
|
||
|
||
def test_flexible_equal(): | ||
assert float("nan") != float("nan") | ||
assert flexible_equal(float("nan"), float("nan")) | ||
assert flexible_equal((42, float("nan")), (42, float("nan"))) | ||
assert not flexible_equal([float("nan"), 11], [float("nan"), 22]) | ||
|
||
def gen(): | ||
yield 11 | ||
yield 22 | ||
|
||
assert flexible_equal(gen(), iter([11, 22])) | ||
assert not flexible_equal(gen(), iter([11, 22, 33])) | ||
assert not flexible_equal(gen(), iter([11])) |