Skip to content

Commit 393a526

Browse files
.Call() entries might have (void) since r-devel/r-svn@acd91c3 (#290)
1 parent 647f05b commit 393a526

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
* `cpp_source()` errors on non-existent file (#261).
88

9+
* updated test to adapt to changes in R 4.2.1 (#290).
10+
911
# cpp11 0.4.2
1012

1113
* Romain François is now the maintainer.

tests/testthat/test-register.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ describe("get_call_entries", {
5858
path <- pkg_path(pkg)
5959
dir.create(file.path(path, "R"))
6060
writeLines('foo <- function() .Call("bar")', file.path(path, "R", "foo.R"))
61+
call_entries <- get_call_entries(path, get_funs(path)$name, get_package_name(path))
62+
# R added `(void)` to the signature after R 4.2.1
63+
expect_match(call_entries[2], "extern SEXP bar[(](void)?[)]")
6164
expect_equal(
62-
get_call_entries(path, get_funs(path)$name, get_package_name(path)),
63-
c("/* .Call calls */",
64-
"extern SEXP bar();",
65-
"",
66-
"static const R_CallMethodDef CallEntries[] = {",
65+
call_entries[4:7],
66+
c("static const R_CallMethodDef CallEntries[] = {",
6767
" {\"bar\", (DL_FUNC) &bar, 0},",
6868
" {NULL, NULL, 0}",
6969
"};"

0 commit comments

Comments
 (0)