Skip to content

Commit

Permalink
add some more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Sep 30, 2024
1 parent 8d6ada3 commit ad026d3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/tests.R
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ test_class("errorValue", raio$data)
r <- n$send(data.frame(), block = FALSE)
if (r == 8L) r <- n$send(data.frame(), block = 500L)
test_zero(r)
test_true(is.data.frame(n1$recv(block = 500)))
r <- n1$recv(block = FALSE)
if (is_error_value(r)) r <- n1$recv(block = 500)
test_class("data.frame", r)
test_zero(n1$send(c("test", "", "spec"), mode = "raw", block = 500))
test_identical(n$recv("character", block = 500), c("test", "", "spec"))
test_zero(n$send(1:5, mode = "r"))
Expand Down Expand Up @@ -156,8 +158,10 @@ test_class("nanoListener", n$listener[[2L]])
test_type("double", stat(n$listener[[2L]], "id"))
test_zero(n$dial(url = "inproc://four"))
test_zero(close(n$listener[[1]]))
test_equal(suppressWarnings(start(n$listener[[1]])), 12L)
test_equal(suppressWarnings(close(n$listener[[1]])), 12L)
test_zero(close(n1$dialer[[1]]))
test_equal(suppressWarnings(start(n1$dialer[[1]])), 12L)
test_equal(suppressWarnings(close(n1$dialer[[1]])), 12L)
test_zero(reap(n$listener[[2]]))
test_zero(reap(n$dialer[[2]]))
Expand Down Expand Up @@ -225,7 +229,7 @@ test_type("integer", req$send(data.frame(), mode = "seri", block = 500))
test_class("recvAio", msg <- recv_aio(ctx, mode = "ser", timeout = 500))
test_type("logical", .unresolved(msg))
test_type("logical", unresolved(msg))
test_true(is.data.frame(call_aio(msg)$data))
test_class("data.frame", call_aio(msg)$data)
test_true(!unresolved(msg))
test_zero(req$send(c(TRUE, FALSE, TRUE), mode = 2L, block = 500))
test_class("recvAio", msg <- recv_aio(ctx, mode = 6L, timeout = 500))
Expand Down Expand Up @@ -309,6 +313,7 @@ test_null(req$context)
rep$dialer <- NULL
test_type("externalptr", rep$dialer[[1L]])
test_zero(close(ctx))
test_equal(suppressWarnings(close(ctx)), 7L)
if (is_nano(p)) test_equal(reap(p), 12L)
if (is_nano(p)) test_equal(suppressWarnings(close(p)), 12L)

Expand Down

0 comments on commit ad026d3

Please sign in to comment.