pydu/tests/structures/test_orderedset.py

13 lines
295 B
Python
Raw Normal View History

2017-10-20 13:27:54 +00:00
from pydu.structures import OrderedSet
def test_ordered_set():
ordered_set = OrderedSet([1, 3, 1, 2])
assert list(ordered_set) == [1, 3, 2]
assert 1 in ordered_set
assert bool(ordered_set)
for i in range(4):
ordered_set.discard(i)
assert not bool(ordered_set)