Skip to content

Commit

Permalink
Add changelog, fix typo, move test
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac-HD committed Nov 15, 2023
1 parent 7719411 commit f4689f2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
8 changes: 8 additions & 0 deletions hypothesis-python/RELEASE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
RELEASE_TYPE: patch

This patch refactors some internals. There is no user-visible change,
but we hope to improve performance and unlock support for alternative
backends such as :pypi:`symbolic execution with crosshair <crosshair-tool>`
in future (:issue:`3086`).

Thanks to Liam DeVoe for this fantastic contribution!
2 changes: 1 addition & 1 deletion hypothesis-python/src/hypothesis/internal/intervalsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(self, intervals):
self.offsets.append(self.offsets[-1] + v - u + 1)
self.size = self.offsets.pop()
self._idx_of_zero = self.index_above(ord("0"))
self._idx_of_Z = min(self.index_above(ord("Z")), len(self.intervals) - 1)
self._idx_of_Z = min(self.index_above(ord("Z")), len(self) - 1)

def __len__(self):
return self.size
Expand Down
9 changes: 9 additions & 0 deletions hypothesis-python/tests/cover/test_intervalset.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,12 @@ def test_interval_intersection(x, y):
print(f"{set(x)=} {set(y)=} {set(x)-(set(y)-set(x))=}")
assert set(x & y) == set(x) & set(y)
assert set(x.intersection(y)) == set(x).intersection(y)


def test_char_in_shrink_order():
xs = IntervalSet([(0, 256)])
assert xs[xs._idx_of_zero] == ord("0")
assert xs[xs._idx_of_Z] == ord("Z")
rewritten = [ord(xs.char_in_shrink_order(i)) for i in range(256)]
assert rewritten != list(range(256))
assert sorted(rewritten) == sorted(range(256))
18 changes: 0 additions & 18 deletions hypothesis-python/tests/cover/test_text.py

This file was deleted.

0 comments on commit f4689f2

Please sign in to comment.