Skip to content

Test more date constructor patterns in a roundtrip tests #7853

@Manishearth

Description

@Manishearth

Related: #7852

We caused a pretty big regression in Date::try_from_fields, see #7847. It is fixed now, but we should have better tests.

icu_calendar has many ways of constructing dates from fields

  • Date::try_from_fields
    • This API can be called with a dozen different input sets: (era + year, extended year, both) + (month type, ordinal month, both, maybe also month codes)
  • Date::try_new() (+ legacy Date::try_from_codes())
  • Date::try_new_foobar()

We should test that all of these roundtrip, especially Date::try_from_fields().

We may also wish to test that we get InconsistentYear and InconsistentMonth when we supply inconsistent values

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-calendarComponent: Calendars

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions