Skip to content

Commit

Permalink
remove fix of previous buggy code
Browse files Browse the repository at this point in the history
  • Loading branch information
areedv committed Nov 23, 2021
1 parent 2986148 commit 1254d9a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
14 changes: 0 additions & 14 deletions R/AutoReportFuns.R
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ upgradeAutoReportData <- function(config) {
upgradeOwnerName <- FALSE
upgradeParams <- FALSE
upgradeStartDate <- FALSE
upgradeStartDateFormat <- FALSE

for (i in seq_len(length(config))) {
rep <- config[[i]]
Expand All @@ -190,12 +189,6 @@ upgradeAutoReportData <- function(config) {
upgradeStartDate <- TRUE
config[[i]]$startDate <- "1900-01-01"
}
if ("startDate" %in% names(rep)) {
if (is.numeric(config[[i]]$startDate)) {
upgradeStartDateFormat <- TRUE
config[[i]]$startDate <- "1900-01-01"
}
}
}

if (upgradeType) {
Expand Down Expand Up @@ -225,13 +218,6 @@ upgradeAutoReportData <- function(config) {
"auto reports with no start date defined now set to 1900-01-01."
))
}
if (upgradeStartDateFormat) {
message(paste(
"Auto report data were fixed:",
"auto reports with messed up (integer) start date now reset to",
"1900-01-01."
))
}

config
}
Expand Down
6 changes: 0 additions & 6 deletions tests/testthat/test-auto-report-functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ test_that("auto report config can be upgraded", {
expect_message(upgradeAutoReportData(list(list(synopsis = "test"))))
})

test_that("auto report start date format bug can be fixed", {
expect_message(upgradeAutoReportData(
list(list(synopsis = "test", startDate = 1.1))
))
})

test_that("already upgraded auto report config is left as is", {
c <- list(list(type = "subscription", ownerName = "Tore Tester",
startDate = "2021-11-19"))
Expand Down

0 comments on commit 1254d9a

Please sign in to comment.