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

test: merged and refactored games.R tests #1682

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

schochastics
Copy link
Contributor

also cleaned up code in games.R (eg stop -> cli::cli_abort)

Copy link
Contributor

aviator-app bot commented Feb 12, 2025

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This pull request is currently open (not queued).

How to merge

To merge this PR, comment /aviator merge or add the mergequeue label.


See the real-time status of this PR on the Aviator webapp.
Use the Aviator Chrome Extension to see the status of your PR within GitHub.

@schochastics schochastics requested a review from maelle February 12, 2025 18:17
@szhorvat
Copy link
Member

When you add these tests, I suggest you look at the functionality with a critical eye. If it seems problematic, or there are obvious possibilities for improvements, this is a good time to signal that. I am referring to things that affect the C library, and are not specific to R only. There is a theoretical possibility to make breaking changes before the 1.0 release.

We have some old functions that are not up to the same quality standards that we try to uphold these days.

Copy link
Contributor

@maelle maelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!! Some comments on error messages, thanks for taking this on!

R/games.R Outdated Show resolved Hide resolved
R/games.R Outdated Show resolved Hide resolved
R/games.R Outdated Show resolved Hide resolved
R/games.R Outdated Show resolved Hide resolved
R/games.R Outdated Show resolved Hide resolved
R/games.R Outdated Show resolved Hide resolved
R/games.R Outdated Show resolved Hide resolved
R/games.R Outdated Show resolved Hide resolved
R/games.R Outdated Show resolved Hide resolved

test_that("sample_chung_lu works", {
chung_lu_small <- sample_chung_lu(c(3, 3, 2, 2, 1, 1))
expect_false(any_multiple(chung_lu_small))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we test for multiple and simple in other places? should we create a custom expectation? (a simple wrapper around expect_false()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maelle I found 2 or 3 uses of it but many other expect_<true|false>(is_xxx())
we could think of adding helpers in a future PR!

@schochastics
Copy link
Contributor Author

When you add these tests, I suggest you look at the functionality with a critical eye. If it seems problematic, or there are obvious possibilities for improvements, this is a good time to signal that. I am referring to things that affect the C library, and are not specific to R only. There is a theoretical possibility to make breaking changes before the 1.0 release.

We have some old functions that are not up to the same quality standards that we try to uphold these days.

Yes that is also something I try to do in parallel. I ping if I find something

schochastics and others added 4 commits February 13, 2025 15:28
Co-authored-by: Maëlle Salmon <[email protected]>
Co-authored-by: Maëlle Salmon <[email protected]>
Co-authored-by: Maëlle Salmon <[email protected]>
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

Successfully merging this pull request may close these issues.

3 participants