-
Notifications
You must be signed in to change notification settings - Fork 235
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
wrapping usage #265
Comments
Test case if I try again in the future. test_that("breaking works after escapes (#265)", {
out <- roc_proc_text(rd_roclet(), "
#' Long args
f <- function(
xxxxxxxxxxxxxxxxxx1,
xxxxxxxxxxxxxxxxxx2,
xxxxxxxxxxxxxxxxxx3,
x = \"\\\"'\",
xxxxxxxxxxxxxxxxxx4,
xxxxxxxxxxxxxxxxxx5,
xxxxxxxxxxxxxxxxxx6,
xxxxxxxxxxxxxxxxxx7
){}")[[1]]
usage <- format(get_tag(out, "usage"))
expect_equal(str_count(usage, "\n"), 5)
}) |
This seems ok to me now: x <- "xxxxxxxxxxxxxxxxxx1,\nxxxxxxxxxxxxxxxxxx2,\nxxxxxxxxxxxxxxxxxx3,\nx = \"\\\"'\",\nxxxxxxxxxxxxxxxxxx4,\nxxxxxxxxxxxxxxxxxx5,\nxxxxxxxxxxxxxxxxxx6,\nxxxxxxxxxxxxxxxxxx7"
width <- function(x) nchar(strsplit(x, "\n")[[1]])
width(wrapString(x))
#> [1] 73 64 21 |
Ooops, no it's not: out <- roc_proc_text(rd_roclet(), "\n #' Long args\n f <- function(\n xxxxxxxxxxxxxxxxxx1,\n xxxxxxxxxxxxxxxxxx2,\n xxxxxxxxxxxxxxxxxx3,\n x = \"\\\"'\",\n xxxxxxxxxxxxxxxxxx4,\n xxxxxxxxxxxxxxxxxx5,\n xxxxxxxxxxxxxxxxxx6,\n xxxxxxxxxxxxxxxxxx7\n ){}")[[1]]
usage <- format(get_tag(out, "usage"))
cat(usage)
#> \usage{
#> f(xxxxxxxxxxxxxxxxxx1, xxxxxxxxxxxxxxxxxx2, xxxxxxxxxxxxxxxxxx3,
#> x = "\\"'", xxxxxxxxxxxxxxxxxx4, xxxxxxxxxxxxxxxxxx5, xxxxxxxxxxxxxxxxxx6, xxxxxxxxxxxxxxxxxx7)
#> } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I ran into a case where the usage section does not wrap when an argument is defaulted to
"\"'"
.I've included a gist that shows this issue: https://gist.github.com/schloerke/ed2fc2947e97480b4946
Thanks,
Barret
The text was updated successfully, but these errors were encountered: