Skip to content
Merged
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
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Config/testthat/edition: 3
Config/usethis/last-upkeep: 2025-07-01
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
RoxygenNote: 7.3.3
SystemRequirements: GNU make, zlib
Collate:
'RcppExports.R'
Expand Down
2 changes: 1 addition & 1 deletion man/runStaticServer.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions tests/testthat/helper-app.R
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
library(curl)
library(promises)


curl_fetch_async <- function(
url,
pool = NULL,
data = NULL,
handle = new_handle()
handle = curl::new_handle()
) {
p <- promises::promise(function(resolve, reject) {
curl_fetch_multi(
curl::curl_fetch_multi(
url,
done = resolve,
fail = reject,
Expand All @@ -22,7 +21,7 @@ curl_fetch_async <- function(
finished <- FALSE
poll <- function() {
if (!finished) {
multi_run(timeout = 0, poll = TRUE, pool = pool)
curl::multi_run(timeout = 0, poll = TRUE, pool = pool)
later::later(poll, 0.01)
}
}
Expand Down Expand Up @@ -98,7 +97,7 @@ fetch <- function(url, handle = curl::new_handle(), gzip = TRUE) {
if (!gzip) {
# Disable gzip; this is often needed only because the unit tests predate
# gzip support in httpuv
handle_setopt(handle, accept_encoding = NULL)
curl::handle_setopt(handle, accept_encoding = NULL)
}

p <- curl_fetch_async(url, handle = handle)
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-app.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
skip_if_not_installed("curl")
library(curl)

test_that("Basic functionality", {
s1 <- startServer(
"127.0.0.1",
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-frame-completion.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Regression test of
# https://github.com/rstudio/httpuv/pull/219

skip_if_not_installed("websocket")

test_that("a close message with no payload is processed", {
# Timing on CRAN build machines can be unreliable.
skip_on_cran()
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-http-parse.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
skip_if_not_installed("curl")
library(curl)

test_that("Large HTTP header values are preserved", {
# This is a test for https://github.com/rstudio/httpuv/issues/275
# When there is a very large header, it may span multiple TCP messages.
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-static-paths.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
skip_if_not_installed("curl")
library(curl)

index_file_content <- raw_file_content(test_path("apps/content/index.html"))
data_file_content <- raw_file_content(test_path("apps/content/data.txt"))
subdir_index_file_content <- raw_file_content(test_path(
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-static-server.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# These tests are time-sensitive, which makes CRAN unhappy.
skip_on_cran()
skip_if_not_installed("curl")
library(curl)

path_example_site <- function(...) {
system.file("example-static-site", ..., package = "httpuv")
Expand Down
Loading