tests/testthat/test-time-and-space.R

context("time and space")

test_that("all operations are timed", {
  expect_true(runif(1e6) %>>% sqrt %>>% sum %>% get_time %>% { all(. >= 0) })
})

test_that("space is recorded for all steps", {
  expect_true(runif(1e6) %>>% sqrt %>>% sum %>% get_mem %>% { all(. >= 0) })
})

Try the rmonad package in your browser

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

rmonad documentation built on March 26, 2020, 7:31 p.m.