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

Follow up on #18 #20

Merged
merged 2 commits into from
Feb 7, 2024
Merged

Follow up on #18 #20

merged 2 commits into from
Feb 7, 2024

Conversation

romainfrancois
Copy link
Collaborator

@romainfrancois romainfrancois commented Feb 6, 2024

closes #19

Copy link
Contributor

aviator-app bot commented Feb 6, 2024

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 PR was merged using Aviator.


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.

})

test_that('<str> == <str> :: "a" == "b"', {
test_that(r"(<str> == <str> :: "a" == "b")", {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🍍

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If using raw strings is an issue, I would argue that we should use test_that(' instead so that we can have double quotes in test_that(desc= without having to escape.


test_expr <- glue::glue(r"[
test_that('{desc} :: {expr$expression}', {{
test_that(r"({desc} :: {expr$expression})", {{
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

using raw strings instead of " from #18 (comment) because some expressions are using quotes, and so we'd have to escape them.

test_that(r"(<str> == <str> :: "a" == "b")", {

As opposed to perhaps this, which looks awful:

test_that("<str> == <str> :: \"a\" == \"b\"", {

Copy link
Collaborator

Choose a reason for hiding this comment

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

Raw strings will not work in older R, but we can change later if this becomes an issue.

@romainfrancois romainfrancois force-pushed the f-testgen-followup branch 2 times, most recently from 4e32bb7 to 8ce0fcb Compare February 6, 2024 13:08
Copy link
Collaborator

@krlmlr krlmlr left a comment

Choose a reason for hiding this comment

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

Great, thanks!


test_expr <- glue::glue(r"[
test_that('{desc} :: {expr$expression}', {{
test_that(r"({desc} :: {expr$expression})", {{
Copy link
Collaborator

Choose a reason for hiding this comment

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

Raw strings will not work in older R, but we can change later if this becomes an issue.

@romainfrancois
Copy link
Collaborator Author

/aviator merge

Copy link
Contributor

aviator-app bot commented Feb 7, 2024

Aviator has accepted the merge request. It will enter the queue when all of the required status checks have passed. Aviator will update the sticky status comment as the pull request moves through the queue.

@aviator-app aviator-app bot merged commit 5c01c29 into main Feb 7, 2024
23 checks passed
@aviator-app aviator-app bot deleted the f-testgen-followup branch February 7, 2024 07:41
Copy link
Collaborator

@krlmlr krlmlr left a comment

Choose a reason for hiding this comment

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

Nice, thanks! I had not considered the quotes issue in the test titles.

@@ -22,7 +22,8 @@ if (Sys.getenv("CI") == "" ) {
fun = fun,
udf = udfs[[fun]],
data = tibble::as_tibble(args),
expression = deparse(expr, nlines = 1L)
expression = deparse(expr, nlines = 1L),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps more consistent with constructive::deparse_call(), but no need to adapt now:

format(constructive::deparse_call(rlang::expr(1 + 2)))
#> [1] "1 + 2"

Created on 2024-02-09 with reprex v2.1.0

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks. I'll block some time to actually learn about constructive

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.

Follow up on #18
2 participants