Skip to content

Commit a56c700

Browse files
committed
range can work with double equal
1 parent f2148e2 commit a56c700

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

codeflash/verification/comparator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def comparator(orig: Any, new: Any, superset_obj=False) -> bool:
8484
frozenset,
8585
enum.Enum,
8686
type,
87+
range
8788
),
8889
):
8990
return orig == new

tests/test_comparator.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,12 @@ def test_basic_python_objects() -> None:
125125
assert comparator(a, b)
126126
assert not comparator(a, c)
127127

128+
a = range(1,10)
129+
b = range(1,10)
130+
c = range(1,20)
131+
assert comparator(a, b)
132+
assert not comparator(a, c)
133+
128134

129135
def test_standard_python_library_objects() -> None:
130136
a = datetime.datetime(2020, 2, 2, 2, 2, 2) # type: ignore

0 commit comments

Comments
 (0)