a

    alorma

    1 year ago
    Hey. looking at the errors, i thouht.... instead of show this:
    com.infojobs.app.base.datasource.cachedb.DateConverterTest > should convert Instant objects FAILED
        org.opentest4j.AssertionFailedError: ▼ Expect that 2021-02-24T14:04:22.023Z:
          ✗ is equal to 2021-02-24T14:04:22.023564Z
                  found 2021-02-24T14:04:22.023Z
    Wouldn't be better to show like this:
    com.infojobs.app.base.datasource.cachedb.DateConverterTest > should convert Instant objects FAILED
        org.opentest4j.AssertionFailedError:
        ▼ Expect that 2021-02-24T14:04:22.023Z:
          ✗ is equal to 2021-02-24T14:04:22.023564Z
                  found 2021-02-24T14:04:22.023Z
    ????
    I mean, move the first assertion line to the below line, to improve readability
    robfletcher

    robfletcher

    1 year ago
    yeah, that probably would be better. Good point
    christophsturm

    christophsturm

    1 year ago
    in failfast i just show it without the “org.opentest4j.AssertionFailedError:” part because its pretty clear that its an assertion failure
    but a solution that works with all test runners would be to subclass AssertionFailedError, wit h a nicer name (maybe `strikt.Failure`` )
    a

    alorma

    1 year ago
    Or just add an
    /n
    to the start of strikt error
    christophsturm

    christophsturm

    1 year ago
    sure, but i mean that the exception name is long and a bit useless .)
    in addition to your suggestion
    a

    alorma

    1 year ago
    Oh ok, cool
    robfletcher

    robfletcher

    1 year ago
    yeah, I think that’s a good plan. I was intending to remove the dependency on opentest4j anyway (as it blocks any possibility of Strikt multi-platform) so creating specific Strikt exception types would make sense
    christophsturm

    christophsturm

    1 year ago
    another thing that is a bit suprising is that the actual value is printed twice
    a

    alorma

    1 year ago
    oh, i thought it was intended
    robfletcher

    robfletcher

    1 year ago
    that’s really because of the
    isEqualTo
    being used. If you’re using another assertion, e.g.
    hasLength
    the assertion output wouldn’t include the actual value of the string, so it’s useful to have it in the “expect that…” part
    christophsturm

    christophsturm

    1 year ago
    isEqual should probably omit the “found” part. Its probably the most used assertion by far
    a

    alorma

    1 year ago
    hi... has this got merged and released?
    robfletcher

    robfletcher

    1 year ago
    not yet. Haven’t had a lot of free time recently
    christophsturm

    christophsturm

    1 year ago
    cool that the solution is so simple. I was going to override the exceptions with shorter names, but you can just override toString