tests/testthat/test-s3-raster.R

test_that("raster", {
  expect_snapshot({
    construct(as.raster(matrix(c("red", "blue", "green", "white"), 2)))
    construct(as.raster(matrix(c(0, 0.5, 1, 0.2, NA, 1), 2)))
    construct(as.raster(matrix(character(), 0, 2)))
    construct(as.raster(matrix(c("red", "blue", "green", "white"), 2)), opts_raster("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.