tests/testthat/test-sfg.R

context('sfg_type')

test_that("correct sfg type is returned",{

  expect_error( sfheaders:::rcpp_get_sfg_type(0), "sfheaders - unknown sfg type" )

  expect_equal( sfheaders:::rcpp_get_sfg_type(1), "POINT" )
  expect_equal( sfheaders:::rcpp_get_sfg_type(2), "MULTIPOINT" )
  expect_equal( sfheaders:::rcpp_get_sfg_type(3), "LINESTRING" )
  expect_equal( sfheaders:::rcpp_get_sfg_type(4), "MULTILINESTRING" )
  expect_equal( sfheaders:::rcpp_get_sfg_type(5), "POLYGON" )
  expect_equal( sfheaders:::rcpp_get_sfg_type(6), "MULTIPOLYGON" )

})

Try the sfheaders package in your browser

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

sfheaders documentation built on May 29, 2024, 1:36 a.m.