tests/testthat/test-nth.R

test_that("nth", {
  x = 1:10

  expect_equal(nth(x,1),1)
  expect_equal(nth(x,5),5)
  expect_equal(nth(x,-1),10)
  expect_equal(nth(x,-2),9)
})
hope-data-science/tidyfst documentation built on Sept. 23, 2024, 8:05 p.m.