tests/testthat/test-s3-crs.R

test_that("crs", {
  skip_on_valgrind()
  skip_if_not_installed("sf")
  skip_if(is.na(suppressWarnings(sf::st_crs(4326)$input)))
  expect_snapshot({
    construct(sf::st_crs(4326))
    construct(sf::st_crs("EPSG:2154"))
    construct(sf::st_crs("OGC:CRS84"))
    construct(sf::st_crs("+proj=longlat +datum=WGS84"))
    construct(sf::st_crs(NA))
    construct(sf::st_crs(NA), opts_crs("next"))
  })
})

Try the constructive package in your browser

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

constructive documentation built on Oct. 22, 2026, 5:07 p.m.