Commit 7cbab175 authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

refactor(test): manage with case sensitivity of the QupstrUnit argument in...

refactor(test): manage with case sensitivity of the QupstrUnit argument in CreateInputsModel and fix test
Refs #110
Showing with 3 additions and 2 deletions
+3 -2
...@@ -216,7 +216,8 @@ CreateInputsModel <- function(FUN_MOD, ...@@ -216,7 +216,8 @@ CreateInputsModel <- function(FUN_MOD,
if(any(LengthHydro > 1000)) { if(any(LengthHydro > 1000)) {
warning("The unit of 'LengthHydro' has changed from m to km in v1.7 of airGR: values superior to 1000 km seem unrealistic") warning("The unit of 'LengthHydro' has changed from m to km in v1.7 of airGR: values superior to 1000 km seem unrealistic")
} }
QupstrUnit <- match.arg(arg = QupstrUnit, choices = c("mm", "m3", "m3/s", "l/s", "L/s")) QupstrUnit <- tolower(QupstrUnit)
QupstrUnit <- match.arg(arg = QupstrUnit, choices = c("mm", "m3", "m3/s", "l/s"))
} }
##check_NA_values ##check_NA_values
......
...@@ -51,7 +51,7 @@ test_that("'QupstrUnit' must correspond to one possible value", { ...@@ -51,7 +51,7 @@ test_that("'QupstrUnit' must correspond to one possible value", {
BasinAreas = BasinAreas, BasinAreas = BasinAreas,
QupstrUnit = "m3/h" QupstrUnit = "m3/h"
), ),
regexp = "'QupstrUnit' must be one of these values: 'mm', 'm3', 'm3/s', 'L/s' or 'l/s'" regexp = "'arg' should be one of “mm, m3, m3/s, l/s"
) )
}) })
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment