Exemple #1
0
 def test_intersection(self):
     s1 = HashSet(['J', 'E', 'R', 'I'])
     s2 = HashSet(['H', 'T', 'E', 'R'])
     s3 = s1.intersection(s2)
     assert s3.contains('E') == True
     assert s3.contains('R') == True
     assert s3.size() == 2
    def test_intersection(self):
        hs1 = HashSet([1, 2, 3, 4])
        hs2 = HashSet([2, 3, 4, 5])

        intersection = hs1.intersection(hs2)
        assert intersection.items() == [2, 3, 4]