Skip to content

expect_comparison could use waldo to determine digits in the failure case? #2006

@MichaelChirico

Description

@MichaelChirico

sprintf("%s is %s %s. Difference: %.3g", act$lab, msg, exp$lab, act$val - exp$val),

Motivation: imbs-hl/ranger#747

I know {waldo} has recently improved "what's the right number of digits to show when compare() fails", so presumably we could re-use that logic here, e.g. compare(act - exp, 0). The specifics may need to be more careful, but I think it's clearly not helpful to have expect_gt() fail with message "Difference: 0".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions