Skip to content

Commit 2dbf4d8

Browse files
test bflSmooth cache plus light (#105)
In order not to fail on some implementations of BLAS, the cache is now tested with all.equal instead of identical.
1 parent f520905 commit 2dbf4d8

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# disaggR 1.0.5.3
22
* Compatibility with ggplot 3.5.0 : Removed the "scale\_name" argument within scales that is now deprecated, new test snapshots (PR #102).
3+
* In order to be back on the CRAN, the tests for the cach are now done with "all.equal" instead of identical. Hence it doesn't fail on some implementation of BLAS (PR #105).
34

45
# disaggR 1.0.5.2
56
* Nothing changed besides the maintener.

tests/testthat/test-bflSmooth.R

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ test_that("cache works for smoothing", {
4343
}
4444
randomargs <- lapply(rep(30,150),randomarg)
4545
randomres <- function(notused) lapply(randomargs,function(x) bflSmooth(x[[1]],x[[2]]))
46-
reslist <- lapply(rep(1,100),randomres)
47-
expect_true(all(sapply(reslist, FUN = identical, randomres(1))))
46+
reslist <- lapply(rep(1,10),randomres)
47+
expect_true(all(sapply(reslist, FUN = function(x, y) isTRUE(all.equal(x, y)), randomres(1))))
4848

4949
set.seed(3)
5050
randomarg <- function(n) {
@@ -55,10 +55,11 @@ test_that("cache works for smoothing", {
5555
}
5656
randomargs <- lapply(rep(30,150),randomarg)
5757
randomres <- function(notused) lapply(randomargs,function(x) bflSmooth(x[[1]],x[[2]],x[[3]]))
58-
reslist <- lapply(rep(1,100),randomres)
59-
expect_true(all(sapply(reslist, FUN = identical, randomres(1))))
58+
reslist <- lapply(rep(1,10),randomres)
59+
expect_true(all(sapply(reslist, FUN = function(x, y) isTRUE(all.equal(x, y)), randomres(1))))
6060
})
6161

62+
6263
test_that("error weights", {
6364
expect_error(bflSmooth(construction,12,weights = 14),"must be either NULL or a one-dimensional ts")
6465
expect_error(bflSmooth(aggregate(turnover,1),12,weights=ts(1:(12*20),freq=4,start=2000)),"frequency of the weights")

tests/testthat/test-plot.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ skips <- function() {
77
as.character(sessionInfo()[c("BLAS","LAPACK")]))
88
)
99
)
10+
skip_if(
11+
any(
12+
grepl("atlas",
13+
as.character(sessionInfo()[c("BLAS","LAPACK")]))
14+
)
15+
)
1016
skip_if(packageVersion("ggplot2") < numeric_version("3.5.0"))
1117
skip_if(getRversion() < numeric_version("4.5.0"))
1218
skip_on_os("mac")

0 commit comments

Comments
 (0)