Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand tests #179

Open
5 tasks
mpadge opened this issue Sep 26, 2024 · 1 comment
Open
5 tasks

Expand tests #179

mpadge opened this issue Sep 26, 2024 · 1 comment

Comments

@mpadge
Copy link
Member

mpadge commented Sep 26, 2024

Several recent PRs have modified output text, yet this had no effect on tests. These include:

Plus new aspects that need to be tested:

And the following which now rely on default lintr messages, rather than hard-coded ones here, and which may or may not have changed?

Tests should obviously cover these explicit strings, yet clearly do not in current form. Ping @MichaelChirico

@MichaelChirico
Copy link
Contributor

Tests should obviously cover these explicit strings

I'm not sure that makes sense, those strings are pretty fragile. See here for the type of clunky workaround I've had to set up for this type of test in the past:

https://github.com/Rdatatable/data.table/blob/e22f7742aee78651fe09aed1434625947dda600a/inst/tests/tests.Rraw#L150-L160

I would recommend testing against something more stable, e.g. as.data.frame(x)$linter or x[[1L]]$linter.

There are some cases (like paste_linter()) where several rules are under the same $linter where you'd have to check some parts of the $message too, in which case I'd try and use a minimal regex instead of capturing the exact string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants