tests: Fix more tests which depend on order of elements in set.
This commit is contained in:
parent
3bb8663282
commit
4d2238d2ce
@ -5,26 +5,26 @@ def r(s):
|
|||||||
sets = [set(), {1}, {1, 2}, {1, 2, 3}, {2, 3}, {2, 3, 5}, {5}, {7}]
|
sets = [set(), {1}, {1, 2}, {1, 2, 3}, {2, 3}, {2, 3, 5}, {5}, {7}]
|
||||||
for s in sets:
|
for s in sets:
|
||||||
for t in sets:
|
for t in sets:
|
||||||
print(s, '|', t, '=', r(s | t))
|
print(r(s), '|', r(t), '=', r(s | t))
|
||||||
print(s, '^', t, '=', r(s ^ t))
|
print(r(s), '^', r(t), '=', r(s ^ t))
|
||||||
print(s, '&', t, '=', r(s & t))
|
print(r(s), '&', r(t), '=', r(s & t))
|
||||||
print(s, '-', t, '=', r(s - t))
|
print(r(s), '-', r(t), '=', r(s - t))
|
||||||
u = s.copy()
|
u = s.copy()
|
||||||
u |= t
|
u |= t
|
||||||
print(s, "|=", t, '-->', r(u))
|
print(r(s), "|=", r(t), '-->', r(u))
|
||||||
u = s.copy()
|
u = s.copy()
|
||||||
u ^= t
|
u ^= t
|
||||||
print(s, "^=", t, '-->', r(u))
|
print(r(s), "^=", r(t), '-->', r(u))
|
||||||
u = s.copy()
|
u = s.copy()
|
||||||
u &= t
|
u &= t
|
||||||
print(s, "&=", t, "-->", r(u))
|
print(r(s), "&=", r(t), "-->", r(u))
|
||||||
u = s.copy()
|
u = s.copy()
|
||||||
u -= t
|
u -= t
|
||||||
print(s, "-=", t, "-->", r(u))
|
print(r(s), "-=", r(t), "-->", r(u))
|
||||||
|
|
||||||
print(s, '==', t, '=', s == t)
|
print(r(s), '==', r(t), '=', s == t)
|
||||||
print(s, '!=', t, '=', s != t)
|
print(r(s), '!=', r(t), '=', s != t)
|
||||||
print(s, '>', t, '=', s > t)
|
print(r(s), '>', r(t), '=', s > t)
|
||||||
print(s, '>=', t, '=', s >= t)
|
print(r(s), '>=', r(t), '=', s >= t)
|
||||||
print(s, '<', t, '=', s < t)
|
print(r(s), '<', r(t), '=', s < t)
|
||||||
print(s, '<=', t, '=', s <= t)
|
print(r(s), '<=', r(t), '=', s <= t)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
print({1,2}.symmetric_difference({2,3}))
|
print(sorted({1,2}.symmetric_difference({2,3})))
|
||||||
print({1,2}.symmetric_difference([2,3]))
|
print(sorted({1,2}.symmetric_difference([2,3])))
|
||||||
s = {1,2}
|
s = {1,2}
|
||||||
print(s.symmetric_difference_update({2,3}))
|
print(s.symmetric_difference_update({2,3}))
|
||||||
l = list(s)
|
l = list(s)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user