def test_generate_index_with_start_end(self, config):
        """Test that generate index returns the expected length, start, and end points
        using `start`, `end`, and `freq` as input.
        Also tests the reverse index generation with a negative frequency.
        """
        start, end, expected_start, expected_start_rev, freq, expected_n_steps = config
        if isinstance(start, str):
            start = pd.Timestamp(start)
            end = pd.Timestamp(end)
            expected_start = (
                pd.Timestamp(expected_start) if expected_start is not None else start
            )
            expected_start_rev = (
                pd.Timestamp(expected_start_rev)
                if expected_start_rev is not None
                else end
            )
            freq = pd.tseries.frequencies.to_offset(freq)
        else:
            expected_start = expected_start if expected_start is not None else start
            expected_start_rev = (
                expected_start_rev if expected_start_rev is not None else end
            )

        idx = generate_index(start=start, end=end, freq=freq)

        if isinstance(freq, int):
            assert idx.step == freq
        else:
            assert idx.freq == freq

        # idx has expected length
        assert len(idx) == expected_n_steps

        if expected_n_steps == 0:
            return

        # start and end are as expected
        assert idx[0] == expected_start
        assert idx[-1] == expected_start + freq * (expected_n_steps - 1)

        # reversed operations generates expected index
        idx_rev = generate_index(start=end, end=start, freq=-freq)
        assert idx_rev[0] == expected_start_rev
        assert idx_rev[-1] == expected_start_rev - freq * (expected_n_steps - 1)
Test that generate index returns the expected length, start, and end points
        using `start`, `end`, and `freq` as input.
        Also tests the reverse index generation with a negative frequency.
        
darts/tests/utils/test_utils.py