]> code.communitydata.science - ml_measurement_error_public.git/blob - simulations/RemembR/R/tests/test_RemembeR.R
bugfix in example.
[ml_measurement_error_public.git] / simulations / RemembR / R / tests / test_RemembeR.R
1 library(testthat)
2 library(data.table)
3 source("../RemembeR.R")
4 test_that("single numbers",{
5     remember(1,"one")
6     expect_equal(r$one,1)
7 }
8 )
9
10 test_that("prefixes",{
11     set.remember.prefix("prefix")
12     remember(2,"two")
13     expect_equal(r$prefix$two,2)
14     expect_equal(r$one,1)
15 }
16 )
17
18 test.dt <- as.data.table(data("mtcars"))
19
20 test_that("data.tables",{
21     set.remember.prefix("")
22     remember(test.dt, 'test.dt')
23     expect_equal(r$test.dt,test.dt)
24 }
25 )

Community Data Science Collective || Want to submit a patch?