Skip to content

Commit 9fa9a1e

Browse files
committed
Respond to changes proposed in tidyverse/glue#295
1 parent 2ddc12f commit 9fa9a1e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

R/register.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ get_call_entries <- function(path, names, package) {
273273

274274
redundant <- glue::glue_collapse(glue::glue('extern SEXP _{package}_{names}'), sep = '|')
275275

276-
if (length(redundant) > 0) {
276+
if (length(redundant) > 0 && nzchar(redundant)) {
277277
redundant <- paste0("^", redundant)
278278
res <- res[!grepl(redundant, res)]
279279
}

tests/testthat/test-register.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ describe("generate_cpp_functions", {
219219
args = list(tibble::tibble(type = character(), name = character()))
220220
)
221221

222-
expect_equal(generate_cpp_functions(funs), character())
222+
expect_equal(generate_cpp_functions(funs), "")
223223
})
224224

225225
it("returns the wrapped function for a single void function with no arguments", {
@@ -388,7 +388,7 @@ describe("generate_r_functions", {
388388
args = list()
389389
)
390390

391-
expect_equal(generate_r_functions(funs), character())
391+
expect_equal(generate_r_functions(funs), "")
392392
})
393393

394394
it("returns the wrapped function for a single void function with no arguments", {

0 commit comments

Comments
 (0)