def test_complex_intersections(self): self.assertEqual(core.domain_intersection([(0, 2), (3, 5)], (3, 4)), [(3, 4)]) self.assertEqual(core.domain_intersection([(0, 2), (3, 5)], (1, 4)), [(1, 2), (3, 4)]) self.assertEqual(core.domain_intersection((1, 4), [(0, 2), (3, 5)]), [(1, 2), (3, 4)]) self.assertEqual(core.domain_intersection([(1, 3), (4, 6)], [(0, 2), (3, 5)]), [(1, 2), (4, 5)]) self.assertEqual(core.domain_intersection([(-10, -4), (2, 5), (10, 17)], [(-20, -5), (3, 5), (7, 23)]), [(-10, -5), (3, 5)], (10, 17))
def test_easy_intersections(self): self.assertEqual(core.domain_intersection((0, 2), (1, 3)), [(1, 2)]) self.assertEqual(core.domain_intersection((0, 1), (1, 3)), []) self.assertEqual(core.domain_intersection((3, 5), (1, 3)), []) self.assertEqual(core.domain_intersection((3, 5), (1, 4)), [(3, 4)]) self.assertEqual(core.domain_intersection((3, 5), (1, 6)), [(3, 5)]) self.assertEqual(core.domain_intersection((3, 5), (6, 7)), [])