Exemplo n.º 1
0
    def test_separate(self) -> None:
        spans = [
            ((1, 1), (2, 1)),
            ((3, 1), (4, 1)),
            ((5, 1), (6, 1)),
        ]

        expected_output = spans.copy()

        self.assertEqual(expected_output, fix8.merge_overlapping_spans(spans))
Exemplo n.º 2
0
    def test_all_overlap(self) -> None:
        spans = [
            ((1, 1), (2, 10)),
            ((1, 1), (3, 1)),
            ((2, 1), (6, 1)),
        ]

        expected_output = [
            ((1, 1), (6, 1)),
        ]

        self.assertEqual(expected_output, fix8.merge_overlapping_spans(spans))
Exemplo n.º 3
0
    def test_overlap_three_of_four(self) -> None:
        spans = [
            ((1, 1), (2, 10)),
            ((1, 1), (4, 1)),
            ((1, 1), (6, 1)),
            ((6, 1), (10, 1)),
        ]

        expected_output = [
            ((1, 1), (10, 1)),
        ]

        self.assertEqual(expected_output, fix8.merge_overlapping_spans(spans))
Exemplo n.º 4
0
    def test_first_completely_overlaps_second(self) -> None:
        spans = [
            ((1, 1), (2, 10)),
            ((2, 1), (2, 5)),
            ((5, 1), (6, 1)),
        ]

        expected_output = [
            ((1, 1), (2, 10)),
            ((5, 1), (6, 1)),
        ]

        self.assertEqual(expected_output, fix8.merge_overlapping_spans(spans))