inst/tinytest/test-allocate.R

o <- hutilscpp:::allocate0_int(10)
expect_identical(o, integer(10))
p <- hutilscpp:::allocate0_dbl(10)
expect_identical(p, double(10))

xc <- hutilscpp:::allocate0_except(10, 2, -2)
o <- integer(10)
o[3] <- -2L
expect_identical(xc, o)
xd <- hutilscpp:::allocate0_except(10L, 2L, -2L)
expect_identical(xd, o)

Ans <- hutilscpp:::.allocate_constants(3)
expect_equal(lengths(Ans, use.names = FALSE), rep(3L, length(Ans)))

Try the hutilscpp package in your browser

Any scripts or data that you put into this service are public.

hutilscpp documentation built on Oct. 11, 2023, 9:06 a.m.