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 get_analysis_date() #136

Merged
merged 1 commit into from
Nov 15, 2023
Merged

Conversation

jdblischak
Copy link
Collaborator

I converted the examples to tests. From running covr locally, get_analysis_date() now has 95.45% coverage

@jdblischak jdblischak self-assigned this Nov 15, 2023
@jdblischak
Copy link
Collaborator Author

Copy link
Collaborator

@nanxstats nanxstats left a comment

Choose a reason for hiding this comment

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

Nice 👍

@nanxstats nanxstats merged commit a04cb30 into Merck:main Nov 15, 2023
@jdblischak jdblischak deleted the test-get_analysis_date branch November 15, 2023 19:22

test_that("target_event_overall", {
observed <- get_analysis_date(simulated_data, target_event_overall = 300)
expect_equal(observed, 25.6150577826303)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you kindly explain the purpose of the testing done after line 49? The output 25.6150577826303 is an unvalidated result. I understand that you may have performed these tests to verify the data.table transformation. If that's the case, would it be possible to rename the file to something like "test-compare with original function output - get_analysis_date"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I need tests in order to refactor the code. This is the only way we will know it continues to behave as you originally designed it. How about test-unvalidated-get_analysis_date.R?

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