tests/testthat/testchunkify.R

library(testthat)
library(ff)

context("chunkify")

test_that("Chunkify a function",{
	x <- 1:10 
	xf <- ff(x)
   
  sin.ff <- chunkify(sin)
   
	expect_identical( sin(x)
	                , sin.ff(xf)[]
				    )
})

test_that("Chunkexpr works with large expressions",{
  ep <- expression(symbol == "000001" & date >= as.Date("1993-03-05") & date <= as.Date("1993-04-13"))
  nm <- c("date", "symbol")
  e <- ffbase:::chunkexpr(ep, nm)
  expect_equal(length(e), 1)
})

Try the ffbase package in your browser

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

ffbase documentation built on Feb. 27, 2021, 5:06 p.m.