MCPcopy Index your code
hub / github.com/python/cpython / test_xor

Method test_xor

Lib/test/test_set.py:200–209  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

198 self.assertEqual(self.thetype('abcba').symmetric_difference(C('ef')), set('abcef'))
199
200 def test_xor(self):
201 i = self.s.symmetric_difference(self.otherword)
202 self.assertEqual(self.s ^ set(self.otherword), i)
203 self.assertEqual(self.s ^ frozenset(self.otherword), i)
204 try:
205 self.s ^ self.otherword
206 except TypeError:
207 pass
208 else:
209 self.fail("s^t did not screen-out general iterables")
210
211 def test_equality(self):
212 self.assertEqual(self.s, set(self.word))

Callers

nothing calls this directly

Calls 4

setFunction · 0.85
symmetric_differenceMethod · 0.80
assertEqualMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected