Skip to content

Commit 60fe684

Browse files
committed
test new getRcppVersion function
1 parent 1e9bcfe commit 60fe684

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

ChangeLog

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
* src/internal.h: Register new version string exporter
1010
* src/rcpp_init.cpp (callEntries[]): Idem
1111

12+
* inst/unitTests/runit.misc.R (test.getRcppVersion): test new function
13+
1214
2019-03-23 Ralf Stubner <[email protected]>
1315

1416
* vignettes/Rcpp-modules.Rmd: Describe RCPP_EXPOSED_* macros

R/tools.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ forceAssignInNamespace <- function(x, value, env) {
2424
is_ns <- isNamespace(env)
2525
unlocker <- get("unlockBinding", baseenv())
2626
if (is_ns && exists(x, env) && bindingIsLocked(x, env)) {
27-
unlocker(x, env)
27+
unlocker(x, env) # #nocov
2828
}
2929
assign(x, value, env)
3030
if (is_ns) {
31-
lockBinding(x, env)
31+
lockBinding(x, env) # #nocov
3232
}
3333
}
3434

inst/unitTests/runit.misc.R

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env r
22
#
3-
# Copyright (C) 2010 - 2017 Dirk Eddelbuettel and Romain Francois
3+
# Copyright (C) 2010 - 2019 Dirk Eddelbuettel and Romain Francois
44
#
55
# This file is part of Rcpp.
66
#
@@ -214,4 +214,11 @@ if (.runThisTest) {
214214
checkTrue(nchar(Rcpp:::bib()) > 0, msg="bib file")
215215
}
216216

217+
test.getRcppVersion <- function() {
218+
checkTrue(inherits(getRcppVersion(), "package_version"),
219+
msg="package_version object")
220+
checkTrue(getRcppVersion(devel=TRUE) >= getRcppVersion(devel=FALSE),
221+
msg="dev greater equal release")
222+
}
223+
217224
}

0 commit comments

Comments
 (0)