Skip to content

Commit

Permalink
No raw strings in old R versions
Browse files Browse the repository at this point in the history
  • Loading branch information
eddelbuettel committed Aug 28, 2024
1 parent 4ac962d commit d7858cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/Rcpp.package.skeleton.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(),
"Description", "License")),
"Imports" = paste(imports, collapse = ", "),
"LinkingTo" = "Rcpp",
"Authors@R" = sprintf(r"(person("%s", "%s", role = c("aut", "cre"), email = "%s"))",
"Authors@R" = sprintf("person(\"%s\", \"%s\", role = c(\"aut\", \"cre\"), email = \"%s\")",
paste(splitname[-length(splitname)], collapse=" "),
splitname[length(splitname)],
email))
Expand Down
4 changes: 3 additions & 1 deletion inst/tinytest/test_rcpp_package_skeleton.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ checkTrue( "foo" %in% list.files(path), "pkg path generated as named" )

## check the DESCRIPTION
DESCRIPTION <- as.list( read.dcf( file.path(pkg_path, "DESCRIPTION") )[1,] )
checkTrue( DESCRIPTION["Authors@R"] == 'person("Boo-Boo", "Bear", role = c("aut", "cre"), email = "yogibear@yogimail.com")', "wrote the Authors@R field in DESCRIPTION" )
checkEqual(gsub("\\n", " ", DESCRIPTION["Authors@R"]), # need to neutralise a line break
'person("Boo-Boo", "Bear", role = c("aut", "cre"), email = "yogibear@yogimail.com")',
"wrote the Authors@R field in DESCRIPTION" )
checkTrue( DESCRIPTION["Date"] == format(Sys.Date()), "uses current date in DESCRIPTION")
checkTrue( DESCRIPTION["License"] == "An Opensource License",
"wrote the License field in DESCRIPTION" )
Expand Down

0 comments on commit d7858cb

Please sign in to comment.