Skip to content

Commit

Permalink
Add test for #376
Browse files Browse the repository at this point in the history
  • Loading branch information
billdenney committed Dec 15, 2022
1 parent ab20789 commit 9f0d412
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/testthat/test-read-xml.R
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,14 @@ test_that("read_xml and read_html fail with > 1 input", {
expect_error(read_xml(c("foo", "bar")), "`x` must be a string of length 1")
expect_error(read_html(c("foo", "bar")), "`x` must be a string of length 1")
})

test_that("read_xml with an invalid file allows deletion of the file (#376)", {
tmp <- tempfile(fileext = ".xml")
on.exit(unlink(tmp))
writeLines("<a>", con = tmp)

expect_error(
read_xml(tmp)
)
expect_true(file.remove(tmp))
})

0 comments on commit 9f0d412

Please sign in to comment.