Skip to content

Commit d6ccbfd

Browse files
committed
Adjust rmultinom test for R-devel change
1 parent 1a9444f commit d6ccbfd

2 files changed

Lines changed: 17 additions & 12 deletions

File tree

ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
* vignettes/RcppArmadillo-intro.pdf: Regenerated
66
* vignettes/RcppArmadillo-sparseMatrix.pdf: Idem
77

8+
* inst/tinytest/test_rmultinom.R: Do not run one sub-test under
9+
R-devel which has switched to a more precise rmultinom()
10+
811
2026-04-16 Dirk Eddelbuettel <edd@debian.org>
912

1013
* DESCRIPTION (Version, Date): Roll micro version and date

inst/tinytest/test_rmultinom.R

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/r -t
22
##
3-
## Copyright (C) 2013 Romain Francois
4-
## Copyright (C) 2014 - 2019 Christian Gunning and Dirk Eddelbuettel
5-
## Copyright (C) 2019 Dirk Eddelbuettel
3+
## Copyright (C) 2013-2026 Romain Francois
4+
## Copyright (C) 2014-2026 Christian Gunning and Dirk Eddelbuettel
5+
## Copyright (C) 2019-2026 Dirk Eddelbuettel
66
##
77
## This file is part of RcppArmadillo.
88
##
@@ -32,17 +32,19 @@ Rcpp::sourceCpp("cpp/rmultinom.cpp")
3232

3333
## test cases
3434
## should be indentical between R and C++
35-
tests <- list(
36-
vanilla=list( n=5, size=100, prob=rep(1/10,10)),
37-
big=list( n=5, size=1e6, prob=rep(1/1e3,1e3)),
38-
fixup.prob=list( n=10, size=1e5, prob=1:10),
39-
n0=list( n=0, size=5, prob=1:10),
40-
size0=list( n=10, size=0, prob=1:10)
35+
tests <- list(vanilla=list( n=5, size=100, prob=rep(1/10,10)),
36+
fixup.prob=list( n=10, size=1e5, prob=1:10),
37+
n0=list( n=0, size=5, prob=1:10),
38+
size0=list( n=10, size=0, prob=1:10)
4139
)
40+
## In April 2026, R-devel improved rmultinom() vai a more precise calculation
41+
## Our calculation here corresponds to the prior version and this test is affected
42+
if (getRversion() < "4.7.0")
43+
tests[["big"]] <- list(n=5, size=1e6, prob=rep(1/1e3,1e3))
4244

43-
fail.tests <- list(
44-
na.prob=list( n=7, size=100, prob=c(1:10,NA)),
45-
prob0=list( n=10, size=100, prob=0)
45+
46+
fail.tests <- list(na.prob=list( n=7, size=100, prob=c(1:10,NA)),
47+
prob0=list( n=10, size=100, prob=0)
4648
)
4749

4850
## these give errors

0 commit comments

Comments
 (0)