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

Refine how macros are discovered #37

Merged
merged 3 commits into from
Oct 23, 2024

Conversation

maksymiuks
Copy link
Collaborator

This is my attempt to address macro problems. It's still a bit new to me, but it should solve our current issue with the roxyreqs package; at least my tests confirm that.

@maksymiuks maksymiuks linked an issue Oct 18, 2024 that may be closed by this pull request
@maksymiuks maksymiuks requested a review from dgkf October 18, 2024 16:22
Copy link

@dgkf-roche dgkf-roche left a comment

Choose a reason for hiding this comment

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

I think a more explicit test is warranted to try to cover this case, but otherwise all the changes look really good. If you haven't used macros before, I can take this on. With a bit of background on the topic it should be a reasonably straightforward test to add.

Comment on lines +15 to +17
rd_macro <- system.file("examples", "macros", "macros.Rd", package = "rd2markdown")
expect_s3_class(get_rd(file = rd_filepath, macros = rd_macro), "Rd")
expect_silent(rd <- get_rd(file = rd_filepath, macros = rd_macro))

Choose a reason for hiding this comment

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

This test doesn't really test the discovery of package macros, which is a pretty central feature here. Can we also add a test for a macro we embed in this package?

You can see a trivial macro here in a package I was working on recently.

We could test it easily by using it in the package docs themselves or alternatively creating a tiny fixture package to test it against.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Tests added!

@maksymiuks maksymiuks merged commit 8c6c6c2 into main Oct 23, 2024
12 checks passed
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.

User-Defined Macros Failing in rd2markdown
2 participants