pydu/tests/datastructures/test_set.py

13 lines
303 B
Python
Raw Normal View History

from pydu.datastructures.set import OrderedSet
2017-10-20 13:27:54 +00:00
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)