# Path: mugen/utilities/location.py
# def intervals_from_locations(locations: List[float]) -> List[float]:
# def locations_from_intervals(intervals: List[float]) -> List[float]:
# def start_end_locations_from_locations(
#     locations: List[float],
# ) -> Tuple[List[float], List[float]]:
# def start_end_locations_from_intervals(
#     intervals: List[float],
# ) -> Tuple[List[float], List[float]]:


import pytest
from mugen.utilities import location

@pytest.mark.parametrize(
    "locations, expected_start_locations, expected_end_locations",
    [
        ([], [], []),
        ([2], [2], [2]),
        ([0, 1, 2], [0, 1, 2], [1, 2, 2]),
        ([1, 2, 5, 10], [1, 2, 5, 10], [2, 5, 10, 10]),
    ],
)
def test_start_end_locations_from_locations(
    locations, expected_start_locations, expected_end_locations
):
    assert location.start_end_locations_from_locations(locations) == (
        expected_start_locations,
        expected_end_locations,
    )


@pytest.mark.parametrize(
    "intervals, expected_start_locations, expected_end_locations",
    [
        ([], [], []),
        ([2], [0], [2]),
        ([1, 2, 5, 10], [0, 1, 3, 8], [1, 3, 8, 18]),
    ],
)
def test_start_end_locations_from_intervals(
    intervals, expected_start_locations, expected_end_locations
):

# Path: mugen/utilities/location.py
# def intervals_from_locations(locations: List[float]) -> List[float]:
# def locations_from_intervals(intervals: List[float]) -> List[float]:
# def start_end_locations_from_locations(
#     locations: List[float],
# ) -> Tuple[List[float], List[float]]:
# def start_end_locations_from_intervals(
#     intervals: List[float],
# ) -> Tuple[List[float], List[float]]:


# Path: tests/unit/utilities/test_location.py
import pytest
from mugen.utilities import location


@pytest.mark.parametrize(
    "locations, expected_start_locations, expected_end_locations",
    [
        ([], [], []),
        ([2], [2], [2]),
        ([0, 1, 2], [0, 1, 2], [1, 2, 2]),
        ([1, 2, 5, 10], [1, 2, 5, 10], [2, 5, 10, 10]),
    ],
)
def test_start_end_locations_from_locations(
    locations, expected_start_locations, expected_end_locations
):
    assert location.start_end_locations_from_locations(locations) == (
        expected_start_locations,
        expected_end_locations,
    )


@pytest.mark.parametrize(
    "intervals, expected_start_locations, expected_end_locations",
    [
        ([], [], []),
        ([2], [0], [2]),
        ([1, 2, 5, 10], [0, 1, 3, 8], [1, 3, 8, 18]),
    ],
)
def test_start_end_locations_from_intervals(
    intervals, expected_start_locations, expected_end_locations
):

    assert location.start_end_locations_from_intervals(intervals) == (