Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ Suggests:
magrittr,
mockery,
rmarkdown,
testthat (>= 3.0.0)
testthat (>= 3.0.0),
withr
VignetteBuilder:
knitr
Config/Needs/website: tidyverse/tidytemplate
Expand Down
9 changes: 9 additions & 0 deletions tests/testthat/test-xml_parse.R
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,12 @@ test_that("read_xml and read_html fail with > 1 input", {
read_html(c("foo", "bar"))
})
})

test_that("read_xml with an invalid file allows deletion of the file (#376)", {
tmp <- withr::local_tempfile(lines = "<a>")

n_cons <- nrow(showConnections())
try(read_xml(tmp), silent = TRUE)
expect_equal(nrow(showConnections()), n_cons)
expect_true(file.remove(tmp))
})