tests/testthat/test-pfm-roundtrip.R

test_that("PFM round-trip works", {
  exr_file <- system.file("image", "rstats.pfm.bz2", package = "picohdr")
  arr      <- read_pfm(exr_file)
  
  tmp_file <- tempfile(fileext = ".pfm")
  write_pfm(arr, tmp_file)  
  
  arr2 <- read_pfm(tmp_file)

  expect_equal(arr, arr2, ignore_attr = TRUE)
})

Try the picohdr package in your browser

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

picohdr documentation built on Oct. 28, 2024, 5:08 p.m.