[R] avoid leaving test files behind (#8685)

This commit is contained in:
James Lamb
2023-01-15 09:34:54 -06:00
committed by GitHub
parent e7d612d22c
commit e227abc57a
3 changed files with 11 additions and 4 deletions

View File

@@ -70,7 +70,7 @@ test_that("xgb.DMatrix: saving, loading", {
# from a libsvm text file
tmp <- c("0 1:1 2:1", "1 3:1", "0 1:1")
tmp_file <- 'tmp.libsvm'
tmp_file <- tempfile(fileext = ".libsvm")
writeLines(tmp, tmp_file)
dtest4 <- xgb.DMatrix(tmp_file, silent = TRUE)
expect_equal(dim(dtest4), c(3, 4))