mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
[3.11] Add tests for empty range equality (GH-103751) (#103760)
(cherry picked from commit dca27a69a8
)
Co-authored-by: Kirill <80244920+Eclips4@users.noreply.github.com>
This commit is contained in:
parent
34df9e740d
commit
25406e5a35
1 changed files with 5 additions and 0 deletions
|
@ -648,6 +648,11 @@ class RangeTest(unittest.TestCase):
|
|||
hash(range(2**200, 2**201, 2**100)))
|
||||
self.assertNotEqual(range(2**200, 2**201, 2**100),
|
||||
range(2**200, 2**201 + 1, 2**100))
|
||||
# Empty ranges
|
||||
self.assertEqual(range(32, 16), range(0))
|
||||
self.assertEqual(hash(range(32, 16)), hash(range(0)))
|
||||
self.assertEqual(range(2, 1, 3), range(0))
|
||||
self.assertEqual(hash(range(2, 1, 3)), hash(range(0)))
|
||||
|
||||
# Order comparisons are not implemented for ranges.
|
||||
with self.assertRaises(TypeError):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue