Skip to content

Commit 533754d

Browse files
committed
finalise tests
1 parent 74890b7 commit 533754d

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

tests/tests.R

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,16 @@ raio <- n1$recv_aio(timeout = 500, keep.raw = TRUE)
7878
raio
7979
raio$newfield <- "doesnotwork"
8080
nanotestn(raio$newfield)
81-
nanotestnn(raio[["aio"]])
82-
nanotest(is_aio(call_aio(raio)))
83-
nanotestn(raio[["aio"]])
84-
nanotest(identical(unserialize(raio$raw), raio$data))
81+
nanotest(is_aio(raio))
8582
saio <- n$send_aio(c(1.1, 2.2), mode = "raw", timeout = 500)
8683
saio$newfield <- "doesnotwork"
8784
nanotestn(saio$newfield)
8885
nanotest(is_aio(saio))
8986
nanotest(is.logical(unresolved(saio)))
87+
nanotestnn(raio$raw)
88+
nanotest(identical(unserialize(call_aio(raio)$raw), raio$data))
89+
nanotestn(raio[["aio"]])
90+
9091
msg <- n1$recv_aio(mode = "numer", keep.raw = TRUE, timeout = 500)
9192
nanotestn(stop_aio(msg))
9293
nanotestn(stop_aio(n))
@@ -236,16 +237,18 @@ nanotestnn(ncurl("http://www.cam.ac.uk/"))
236237
nanotestnn(ncurl("http://www.cam.ac.uk/", follow = TRUE))
237238
nanotestnn(ncurl("http://httpbin.org/post", convert = FALSE, method = "POST", headers = c(`Content-Type` = "text/plain"), data = "test", response = "server"))
238239
nanotestnn(ncurl("http://httpbin.org/post", convert = FALSE, method = "POST", headers = list(`Content-Type` = "text/plain"), response = list("Date", "Server")))
239-
nanotest(is_error_value(ncurl("http")$raw))
240+
relo <- ncurl("http://www.cam.ac.uk/", async = TRUE)
241+
nanotest(is.integer(call_aio(relo)$status))
240242
put1 <- ncurl("http://httpbin.org/put", async = TRUE, method = "PUT", headers = c(Authorization = "Bearer token"), data = "test", response = c("date", "server"))
241243
nanotest(is.integer(call_aio(put1)$status))
242244
nanotestnn(put1$headers)
243245
nanotestnn(put1$raw)
244246
nanotestnn(put1$data)
245247
put2 <- ncurl("http://httpbin.org/put", async = TRUE, method = "PUT", headers = list(Authorization = "Bearer token"), response = list("date", "server"))
246248
put2
247-
nanotestnn(put2$status)
249+
nanotest(is.list(call_aio(put2)$headers))
248250
nanotest(is.null(stop_aio(put2)))
251+
nanotest(is_error_value(ncurl("http")$raw))
249252
nanotest(is_error_value(ncurl("http", async = TRUE)$data))
250253
haio <- ncurl("https://i.i", async = TRUE)
251254
nanotest(is_error_value(call_aio(haio)$raw))

0 commit comments

Comments
 (0)