MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_symmetric_difference

Method test_symmetric_difference

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

Source from the content-addressed store, hash-verified

181 self.fail("s-t did not screen-out general iterables")
182
183 def test_symmetric_difference(self):
184 i = self.s.symmetric_difference(self.otherword)
185 for c in self.letters:
186 self.assertEqual(c in i, (c in self.d) ^ (c in self.otherword))
187 self.assertEqual(self.s, self.thetype(self.word))
188 self.assertEqual(type(i), self.basetype)
189 self.assertRaises(PassThru, self.s.symmetric_difference, check_pass_thru())
190 self.assertRaises(TypeError, self.s.symmetric_difference, [[]])
191 for C in set, frozenset, dict.fromkeys, str, list, tuple:
192 self.assertEqual(self.thetype('abcba').symmetric_difference(C('cdc')), set('abd'))
193 self.assertEqual(self.thetype('abcba').symmetric_difference(C('efgfe')), set('abcefg'))
194 self.assertEqual(self.thetype('abcba').symmetric_difference(C('ccb')), set('a'))
195 self.assertEqual(self.thetype('abcba').symmetric_difference(C('ef')), set('abcef'))
196
197 def test_xor(self):
198 i = self.s.symmetric_difference(self.otherword)

Callers

nothing calls this directly

Calls 6

check_pass_thruFunction · 0.85
setFunction · 0.85
CClass · 0.70
symmetric_differenceMethod · 0.45
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected