def test_cftime_range_no_freq(start, end, periods):
    """
    Test whether date_range produces the same result as Pandas
    when freq is not provided, but start, end and periods are.
    """
    # Generate date ranges using cftime_range
    cftimeindex = date_range(start=start, end=end, periods=periods, use_cftime=True)
    result = cftimeindex.to_datetimeindex(time_unit="ns")
    expected = pd.date_range(start=start, end=end, periods=periods)

    np.testing.assert_array_equal(result, expected)

    Test whether date_range produces the same result as Pandas
    when freq is not provided, but start, end and periods are.
    
xarray/tests/test_cftime_offsets.py