tests/testthat/test-drop_class.R

test_that("dropping class works", {
  m <- mt_sim_brownian_motion(1L:3L)
  expect_false(inherits(mt_set_time(m, NULL), "move2"))
  expect_s3_class(mt_set_time(m, NULL), "sf")
  expect_false(inherits(mt_set_track_id(m, NULL), "move2"))
  expect_s3_class(mt_set_track_id(m, NULL), "sf")
  expect_false(has_attr(mt_set_track_id(m, NULL), "track_id_column"))
  expect_false(has_attr(mt_set_time(m, NULL), "time_column"))
})

Try the move2 package in your browser

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

move2 documentation built on April 4, 2025, 12:24 a.m.