context("generate: r (tools)")

## Because we put the scalar variables into the packing first, they
## never trigger the language branch of this function.  But that's
## something that could in theory change.
test_that("r_offset_to_position", {
  expect_equal(r_offset_to_position(0), 1)
  expect_equal(r_offset_to_position(10), 11)
  expect_equal(r_offset_to_position(quote(x)), quote(x + 1L))
  expect_equal(r_offset_to_position(quote(f(x))), quote(f(x) + 1L))

Try the odin package in your browser

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

odin documentation built on April 28, 2022, 9:05 a.m.