Skip to content

Commit c6c7421

Browse files
committed
add sub-super unittest for set and frozenset
1 parent b1daaf0 commit c6c7421

File tree

1 file changed

+18
-0
lines changed
  • graalpython/com.oracle.graal.python.test/src/tests

1 file changed

+18
-0
lines changed

graalpython/com.oracle.graal.python.test/src/tests/test_set.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,3 +156,21 @@ def test_difference_update():
156156
s = set('abcdefghih')
157157
s.difference_update(C('cdc'), C('aba'))
158158
assert s == set('efghih')
159+
160+
161+
def test_sub_and_super():
162+
for thetype in [set, frozenset]:
163+
p, q, r = map(thetype, ['ab', 'abcde', 'def'])
164+
assert p < q
165+
assert p <= q
166+
assert q <= q
167+
assert q > p
168+
assert q >= p
169+
assert not q < r
170+
assert not q <= r
171+
assert not q > r
172+
assert not q >= r
173+
assert set('a').issubset('abc')
174+
assert set('abc').issuperset('a')
175+
assert not set('a').issubset('cbs')
176+
assert not set('cbs').issuperset('a')

0 commit comments

Comments
 (0)