Skip to content

Commit

Permalink
#117: numeric test fixes for Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
james-vivodyne committed Feb 4, 2024
1 parent 9a42cdf commit 22b0982
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tests/testthat/test_saveload.R
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,12 @@ test_that("reload-correlation", {
n_epochs = 2,
ret_extra = c("nn"))

expect_equal(transformed_before_reload$nn$correlation$dist,
model$nn$correlation$dist, check.attributes = FALSE)
expect_equal(
transformed_before_reload$nn$correlation$dist,
model$nn$correlation$dist,
check.attributes = FALSE,
tol = 1e-7
)

mod_fname <- tempfile(tmpdir = tempdir())
model <- save_uwot(model, file = mod_fname, unload = TRUE)
Expand All @@ -171,8 +175,12 @@ test_that("reload-correlation", {
modelload,
n_epochs = 2,
ret_extra = c("nn"))
expect_equal(transformed_after_reload$nn$correlation$dist,
model$nn$correlation$dist, check.attributes = FALSE)
expect_equal(
transformed_after_reload$nn$correlation$dist,
model$nn$correlation$dist,
check.attributes = FALSE,
tol = 1e-7
)

if (file.exists(mod_fname)) {
unlink(mod_fname)
Expand Down

0 comments on commit 22b0982

Please sign in to comment.