summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_sets.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_sets.py')
-rw-r--r--Lib/test/test_sets.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_sets.py b/Lib/test/test_sets.py
index 1b26d4c..9cc586f 100644
--- a/Lib/test/test_sets.py
+++ b/Lib/test/test_sets.py
@@ -732,6 +732,16 @@ class TestIdentities(unittest.TestCase):
if a != b:
self.assertNotEqual(a-b, b-a)
+ def test_reflexsive_relations(self):
+ a, zero = self.a, Set()
+ self.assertEqual(a ^ a, zero)
+ self.assertEqual(a - a, zero)
+ self.assertEqual(a | a, a)
+ self.assertEqual(a & a, a)
+ self.assert_(a <= a)
+ self.assert_(a >= a)
+ self.assert_(a == a)
+
def test_summations(self):
# check that sums of parts equal the whole
a, b = self.a, self.b
@@ -756,6 +766,7 @@ class TestIdentities(unittest.TestCase):
self.assertEqual(len(b), len(b-a) + len(a&b))
self.assertEqual(len(a^b), len(a-b) + len(b-a))
self.assertEqual(len(a|b), len(a-b) + len(a&b) + len(b-a))
+ self.assertEqual(len(a^b) + len(a&b), len(a|b))
#==============================================================================