Skip to content

Commit

Permalink
Fix a unit test for winbuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Aug 23, 2024
1 parent 039a5a2 commit 09f8c46
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
5.2.2
- Disable a compression test for libcurl 8.7.1 which has a bug for deflate
- Change a unit test to work better on winbuilder

5.2.1
- In handle_setheader(), setting a header to a non-empty whitespace string will
Expand Down
10 changes: 5 additions & 5 deletions tests/testthat/test-certificates.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ test_that("CloudFlare / LetsEncrypt certs", {
})

test_that("Invalid domain raises an error", {
ipaddr <- nslookup("www.google.com", ipv4_only = TRUE)
fake_url <- paste0("https://", ipaddr)
expect_error(curl_fetch_memory(fake_url), "certificate")
expect_is(curl_fetch_memory(fake_url, handle = new_handle(
ssl_verifyhost = FALSE, ssl_verifypeer = FALSE))$status, "integer")
ipaddr <- nslookup("www.r-project.org", ipv4_only = TRUE)
h <- new_handle(resolve = paste0("fakehostname:443:", ipaddr))
expect_error(curl_fetch_memory("https://fakehostname", handle = h), "certificate")
handle_setopt(h, ssl_verifyhost = FALSE, ssl_verifypeer = FALSE)
expect_is(curl_fetch_memory("https://fakehostname", handle = h)$status, "integer")
})

test_that("GC works", {
Expand Down

0 comments on commit 09f8c46

Please sign in to comment.