Skip to content

Filter is failing with ZonedDateTime generator #38

@hghina0

Description

@hghina0

genZonedDateTime has very big space for year which is preventing strict date formatting like yyyyMMdd.

year <- Gen.choose(-292278994, 292278994)

With above range below filter mostly fails

year <- Gen.choose(-292278994, 292278994) suchThat{r => r.getYear()>1970 && r.getYear()<3000}

I know the range is due to

TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
Timestamp t1 = new Timestamp(Long.MIN_VALUE);
assertEquals("292278994-08-17 07:12:55.192", t1.toString());

However, it is better if library can provide some way to constraint year range for rational generator

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions