Skip to content

Commit

Permalink
Add more tests for the powerset() recipe.
Browse files Browse the repository at this point in the history
  • Loading branch information
rhettinger committed Jan 27, 2009
1 parent 3471b1c commit 191e850
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Lib/test/test_itertools.py
Original file line number Diff line number Diff line change
Expand Up @@ -1512,6 +1512,12 @@ def __init__(self, newarg=None, *args):
>>> list(powerset([1,2,3]))
[(), (1,), (2,), (3,), (1, 2), (1, 3), (2, 3), (1, 2, 3)]
>>> all(len(list(powerset(range(n)))) == 2**n for n in range(18))
True
>>> list(powerset('abcde')) == sorted(sorted(set(powerset('abcde'))), key=len)
True
>>> list(unique_everseen('AAAABBBCCDAABBB'))
['A', 'B', 'C', 'D']
Expand Down

0 comments on commit 191e850

Please sign in to comment.