Skip to content

Commit

Permalink
snapshot dates starting with 0 are troublesome
Browse files Browse the repository at this point in the history
  • Loading branch information
dajmcdon committed Oct 19, 2024
1 parent 244dacb commit fe09e6a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tests/testthat/_snaps/snapshots.md
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@
Message
== A basic forecaster of type ARX Forecaster ===================================
This forecaster was fit on 0999-01-01.
This forecaster was fit on 1999-01-01.
Training data was an <epi_df> with:
* Geography: state,
Expand All @@ -1113,7 +1113,7 @@
Message
== A basic forecaster of type ARX Forecaster ===================================
This forecaster was fit on 0999-01-01.
This forecaster was fit on 1999-01-01.
Training data was an <epi_df> with:
* Geography: state,
Expand All @@ -1137,7 +1137,7 @@
Message
== A basic forecaster of type ARX Forecaster ===================================
This forecaster was fit on 0999-01-01.
This forecaster was fit on 1999-01-01.
Training data was an <epi_df> with:
* Geography: state,
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-snapshots.R
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ test_that("arx_forecaster output format snapshots", {
c("case_rate", "death_rate")
)
expect_equal(as.Date(format(out1$metadata$forecast_created, "%Y-%m-%d")), Sys.Date())
out1$metadata$forecast_created <- as.Date("0999-01-01")
out1$metadata$forecast_created <- as.Date("1999-01-01")
expect_snapshot(out1)
out2 <- arx_forecaster(jhu, "case_rate",
c("case_rate", "death_rate"),
Expand All @@ -130,7 +130,7 @@ test_that("arx_forecaster output format snapshots", {
)
)
expect_equal(as.Date(format(out2$metadata$forecast_created, "%Y-%m-%d")), Sys.Date())
out2$metadata$forecast_created <- as.Date("0999-01-01")
out2$metadata$forecast_created <- as.Date("1999-01-01")
expect_snapshot(out2)
out3 <- arx_forecaster(jhu, "death_rate",
c("case_rate", "death_rate"),
Expand All @@ -141,7 +141,7 @@ test_that("arx_forecaster output format snapshots", {
)
)
expect_equal(as.Date(format(out3$metadata$forecast_created, "%Y-%m-%d")), Sys.Date())
out3$metadata$forecast_created <- as.Date("0999-01-01")
out3$metadata$forecast_created <- as.Date("1999-01-01")
expect_snapshot(out3)
})

Expand Down

0 comments on commit fe09e6a

Please sign in to comment.