Browse Source

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

pull/3495/head
Damien George 7 years ago
parent
commit
7208cad97a
  1. 6
      tests/basics/set_binop.py
  2. 3
      tests/basics/set_isfooset.py

6
tests/basics/set_binop.py

@ -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:

3
tests/basics/set_isfooset.py

@ -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))

Loading…
Cancel
Save