def test_generate_index_with_end_length(self, config):
        """Test that generate index returns the expected length, start, and end points
        using `end`, `length`, and `freq` as input.
        """
        expected_start, end, freq, n_steps = config

        if isinstance(end, str):
            freq = pd.tseries.frequencies.to_offset(freq)
            expected_start = (
                pd.Timestamp(expected_start) if expected_start is not None else None
            )
            end = pd.Timestamp(end)
        idx = generate_index(end=end, length=n_steps, freq=freq)
        assert len(idx) == n_steps
        if n_steps == 0:
            return

        assert idx[0] == expected_start
        assert idx[-1] == expected_start + (n_steps - 1) * freq
Test that generate index returns the expected length, start, and end points
        using `end`, `length`, and `freq` as input.
        
darts/tests/utils/test_utils.py