Commit 7bbce4e2 authored by Damien George's avatar Damien George
Browse files

tests/basics/set_pop: Improve coverage of set functions.

parent b470f598
......@@ -7,3 +7,12 @@ except KeyError:
else:
print("Failed to raise KeyError")
# this tests an optimisation in mp_set_remove_first
# N must not be equal to one of the values in hash_allocation_sizes
N = 11
s = set(range(N))
while s:
print(s.pop()) # last pop() should trigger the optimisation
for i in range(N):
s.add(i) # check that we can add the numbers back to the set
print(list(s))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment