tests/testthat/test-print.R

context("test-print.R")

test_that("print works", {
  ufile <- system.file("extdata", "unidata", "madis-hydro.nc", 
                       package = "tidync")
  
  tnc <- expect_s3_class(tidync(ufile), "tidync")
  expect_output(print(tnc))
  
  ab <- expect_output(print(hyper_array(tidync(ufile), select_var = c('precip6hrQCD', 'precip12hrQCD'))))
  expect_s3_class(ab, "tidync_data")
  expect_length(ab, 2)
  expect_named(ab, c('precip6hrQCD', 'precip12hrQCD'))
  expect_named(attr(ab, "transforms"), c("QCcheckNum", "recNum"))
  
  tst <- hyper_tibble(tnc, QCcheckNum = dplyr::between(index, 2, 8), 
                           recNum = recNum > 1100, na.rm = FALSE)
})

Try the tidync package in your browser

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

tidync documentation built on Oct. 29, 2022, 1:15 a.m.