From c8853e4ea3815f61156e7761c48d850c28235393 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Wed, 30 Mar 2022 20:46:15 -0500 Subject: [PATCH] [R-package] add assertions to test on lightgbm() weights --- R-package/tests/testthat/test_basic.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R-package/tests/testthat/test_basic.R b/R-package/tests/testthat/test_basic.R index 3c6707d4fd02..637e17b6f893 100644 --- a/R-package/tests/testthat/test_basic.R +++ b/R-package/tests/testthat/test_basic.R @@ -2941,6 +2941,7 @@ test_that("lightgbm() accepts 'weight' and 'weights'", { , nrounds = 5L , verbose = -1L ) + expect_equal(model$.__enclos_env__$private$train_set$get_field("weight"), w) # Avoid a bad CRAN check due to partial argument matches lgb_args <- list( @@ -2952,4 +2953,5 @@ test_that("lightgbm() accepts 'weight' and 'weights'", { , verbose = -1L ) model <- do.call(lightgbm, lgb_args) + expect_equal(model$.__enclos_env__$private$train_set$get_field("weight"), w) })