advance on tests
[talweg.git] / pkg / tests / testthat / test.dateIndexToInteger.R
CommitLineData
a65907cc 1context("Check that dateIndexToInteger behaves as expected")
1e20780e 2
6d97bfec 3getDataTest = function(n, shift)
a65907cc 4{
a65907cc
BA
5 n = 1500
6 series = list()
6d97bfec
BA
7 s = rep(0, 24)
8
a65907cc 9 for (i in seq_len(n))
1e20780e 10 {
6d97bfec
BA
11 level = i %% 3mean(s[[index]])
12 serie = s
a65907cc
BA
13 # 10 series with NAs for index 2
14 if (index == 2 && i >= 60 && i<= 90)
15 serie[sample(seq_len(L),1)] = NA
6d97bfec 16 series[[i]] = list("level"=i%%3, "serie"=s, "time"=)
1e20780e 17 }
a65907cc 18 data = new("Data", data=series)
6d97bfec 19}
1e20780e 20
6d97bfec
BA
21test_that("integer index matches date in data, predict_at == 0",
22{
23 data = getData(
a65907cc
BA
24 dateIndexToInteger = function(index, data)
25})
6d97bfec
BA
26
27test_that("integer index matches date in data, predict_at > 0",
28{
29
30
31
32
33 ####TODO: CSV as raw data in inst/extdata http://r-pkgs.had.co.nz/data.html