"...git@developer.sourcefind.cn:tianlh/lightgbm-dcu.git" did not exist on "e1d7a7b9e332851063ebb066d395937afefe76f1"
Unverified Commit f4970686 authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

[R-package] allow for small numerical differences in Booster test (#4714)

* [R-package] allow for small numerical differences in Booster test

* only use less-strict test on Windows
parent 717f037c
context("Booster") context("Booster")
ON_WINDOWS <- .Platform$OS.type == "windows"
TOLERANCE <- 1e-6 TOLERANCE <- 1e-6
test_that("Booster$finalize() should not fail", { test_that("Booster$finalize() should not fail", {
...@@ -466,7 +467,11 @@ test_that("Booster$eval() should work on a Dataset stored in a binary file", { ...@@ -466,7 +467,11 @@ test_that("Booster$eval() should work on a Dataset stored in a binary file", {
) )
expect_true(abs(eval_in_mem[[1L]][["value"]] - 0.1744423) < TOLERANCE) expect_true(abs(eval_in_mem[[1L]][["value"]] - 0.1744423) < TOLERANCE)
expect_identical(eval_in_mem, eval_from_file) if (isTRUE(ON_WINDOWS)) {
expect_equal(eval_in_mem, eval_from_file)
} else {
expect_identical(eval_in_mem, eval_from_file)
}
}) })
test_that("Booster$rollback_one_iter() should work as expected", { test_that("Booster$rollback_one_iter() should work as expected", {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment