Skip to content

Commit bcc2813

Browse files
author
raymond.hettinger
committed
Add more tests for the powerset() recipe.
git-svn-id: http://svn.python.org/projects/python/trunk@69023 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent e507420 commit bcc2813

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Lib/test/test_itertools.py

+6
Original file line numberDiff line numberDiff line change
@@ -1491,6 +1491,12 @@ def __init__(self, newarg=None, *args):
14911491
>>> list(powerset([1,2,3]))
14921492
[(), (1,), (2,), (3,), (1, 2), (1, 3), (2, 3), (1, 2, 3)]
14931493
1494+
>>> all(len(list(powerset(range(n)))) == 2**n for n in range(18))
1495+
True
1496+
1497+
>>> list(powerset('abcde')) == sorted(sorted(set(powerset('abcde'))), key=len)
1498+
True
1499+
14941500
>>> list(unique_everseen('AAAABBBCCDAABBB'))
14951501
['A', 'B', 'C', 'D']
14961502

0 commit comments

Comments
 (0)