ignore HTML generated vignettes (Rmarkdown)
[talweg.git] / pkg / tests / testthat / test.dateIndexToInteger.R
CommitLineData
a65907cc 1context("Check that dateIndexToInteger behaves as expected")
1e20780e 2
613a986f 3test_that("computed integer index is correct; predict_at == 0",
a65907cc 4{
613a986f
BA
5 data0 = getData(ts_data="pm10_mesures_H_loc.csv", exo_data="meteo_extra_noNAs.csv",
6 input_tz="Europe/Paris",working_tz="Europe/Paris", predict_at=0, limit=200)
7 expect_identical( dateIndexToInteger("2008-12-10",data), 1 )
8 expect_identical( dateIndexToInteger("2008-12-11",data), 2 )
9 expect_identical( dateIndexToInteger("2008-12-20",data), 11 )
10 expect_identical( dateIndexToInteger("2009-02-01",data), 53 )
11 expect_identical( dateIndexToInteger("2009-03-01",data), 81 )
12 expect_identical( dateIndexToInteger("2009-05-31",data), 172 )
a65907cc 13})
6d97bfec 14
613a986f 15test_that("computed integer index is correct; predict_at > 0",
6d97bfec 16{
613a986f
BA
17 data7 = getData(ts_data="pm10_mesures_H_loc.csv", exo_data="meteo_extra_noNAs.csv",
18 input_tz="Europe/Paris",working_tz="Europe/Paris", predict_at=7, limit=200)
19 expect_identical( dateIndexToInteger("2008-12-10",data), 2 )
20 expect_identical( dateIndexToInteger("2008-12-11",data), 3 )
21 expect_identical( dateIndexToInteger("2008-12-20",data), 12 )
22 expect_identical( dateIndexToInteger("2009-02-01",data), 54 )
23 expect_identical( dateIndexToInteger("2009-03-01",data), 82 )
24 expect_identical( dateIndexToInteger("2009-05-31",data), 173 )
25}