Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for #376 #379

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
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))
})
Loading