Skip to content

Tolerance for testing column value equality #326

@rich-iannone

Description

@rich-iannone

Apply this to col_vals_equal() and col_vals_not_equal() (plus the variants of those functions). Use whatever testthat 3e uses for tolerance (based on all_equal()). Make sure this works in YAML, when creating testthat files, and across all data sources (e.g., databases).

Thank you @eveyp for this! (original post from Discussions below)

Discussed in posit-dev/pointblank#325

Originally posted by eveyp June 30, 2021
Would it be possible to specify a tolerance when testing if column values are equal to a specified value? This would be helpful to avoid floating point round off issues.

It could be similar to how testthat has expect_equal() which allows for a tolerance and expect_identical() which requires the values to be exactly the same (https://testthat.r-lib.org/reference/equality-expectations.html).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions