~pythonregexp2.7/python/issue2636-12

« back to all changes in this revision

Viewing changes to Lib/test/test_set.py

  • Committer: Jeffrey C. "The TimeHorse" Jacobs
  • Date: 2008-06-09 14:52:42 UTC
  • mfrom: (39033.1.3 Regexp-2.6)
  • Revision ID: darklord@timehorse.com-20080609145242-9m268zc6u87rp1vp
Merged in changes from the core Regexp branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
            self.assertEqual(self.thetype('abcba').union(C('efgfe')), set('abcefg'))
79
79
            self.assertEqual(self.thetype('abcba').union(C('ccb')), set('abc'))
80
80
            self.assertEqual(self.thetype('abcba').union(C('ef')), set('abcef'))
 
81
            self.assertEqual(self.thetype('abcba').union(C('ef'), C('fg')), set('abcefg'))
81
82
 
82
83
    def test_or(self):
83
84
        i = self.s.union(self.otherword)
401
402
                s = self.thetype('abcba')
402
403
                self.assertEqual(s.update(C(p)), None)
403
404
                self.assertEqual(s, set(q))
 
405
        for p in ('cdc', 'efgfe', 'ccb', 'ef', 'abcda'):
 
406
            q = 'ahi'
 
407
            for C in set, frozenset, dict.fromkeys, str, unicode, list, tuple:
 
408
                s = self.thetype('abcba')
 
409
                self.assertEqual(s.update(C(p), C(q)), None)
 
410
                self.assertEqual(s, set(s) | set(p) | set(q))
404
411
 
405
412
    def test_ior(self):
406
413
        self.s |= set(self.otherword)