tests_sortin/testthat/test_gs_square.R

library(checkmate)
library(testthat)
context("gs_square")


test_that("output is valid geometry", {
  coords <- data.frame(x = c(40, 70, 70, 50),
                       y = c(40, 40, 60, 70),
                       fid = 1)

  output <- gs_square(anchor = coords)
  expect_class(output, classes = "geom")
  expect_true(output@type == "polygon")
  expect_data_frame(output@point, any.missing = FALSE, nrows = 5, ncols = 3)
})
EhrmannS/geometr documentation built on Jan. 31, 2024, 9:13 a.m.