tests/basics: Add more set tests to improve coverage of py/objset.c.

This commit is contained in:
Damien George 2017-12-19 13:59:54 +11:00
parent 136cb7f27c
commit 7208cad97a
2 changed files with 8 additions and 1 deletions

View File

@ -60,6 +60,12 @@ except TypeError:
print('TypeError')
# unsupported operator
try:
set('abc') * set('abc')
except TypeError:
print('TypeError')
# unsupported operator with RHS not a set
try:
set('abc') * 2
except TypeError:

View File

@ -1,5 +1,6 @@
sets = [set(), {1}, {1, 2, 3}, {3, 4, 5}, {5, 6, 7}]
args = sets + [[1], [1, 2], [1, 2 ,3]]
for i in sets:
for j in sets:
for j in args:
print(i.issubset(j))
print(i.issuperset(j))