Skip to content

Commit d7858cb

Browse files
committed
No raw strings in old R versions
1 parent 4ac962d commit d7858cb

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

R/Rcpp.package.skeleton.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(),
8686
"Description", "License")),
8787
"Imports" = paste(imports, collapse = ", "),
8888
"LinkingTo" = "Rcpp",
89-
"Authors@R" = sprintf(r"(person("%s", "%s", role = c("aut", "cre"), email = "%s"))",
89+
"Authors@R" = sprintf("person(\"%s\", \"%s\", role = c(\"aut\", \"cre\"), email = \"%s\")",
9090
paste(splitname[-length(splitname)], collapse=" "),
9191
splitname[length(splitname)],
9292
email))

inst/tinytest/test_rcpp_package_skeleton.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ checkTrue( "foo" %in% list.files(path), "pkg path generated as named" )
4545

4646
## check the DESCRIPTION
4747
DESCRIPTION <- as.list( read.dcf( file.path(pkg_path, "DESCRIPTION") )[1,] )
48-
checkTrue( DESCRIPTION["Authors@R"] == 'person("Boo-Boo", "Bear", role = c("aut", "cre"), email = "[email protected]")', "wrote the Authors@R field in DESCRIPTION" )
48+
checkEqual(gsub("\\n", " ", DESCRIPTION["Authors@R"]), # need to neutralise a line break
49+
'person("Boo-Boo", "Bear", role = c("aut", "cre"), email = "[email protected]")',
50+
"wrote the Authors@R field in DESCRIPTION" )
4951
checkTrue( DESCRIPTION["Date"] == format(Sys.Date()), "uses current date in DESCRIPTION")
5052
checkTrue( DESCRIPTION["License"] == "An Opensource License",
5153
"wrote the License field in DESCRIPTION" )

0 commit comments

Comments
 (0)