Running 'testthat.R' [10s/17s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(blaise)
  > 
  > test_check("blaise")
  [ FAIL 7 | WARN 0 | SKIP 0 | PASS 364 ]
  
  == Failed tests ================================================================
  -- Error (test_types.R:34:3): all types get read back identically for a dataframe --
  Error in `(function (col, var) 
  {
      nas = is.na(col)
      if (is.factor(col)) {
          if (is.numbered_enum(levels(col))) {
              col = as.character(col)
              col[!nas] = format(col[!nas], width = width(var), 
                  justify = justify)
          }
          else {
              col = as.integer(col)
              col[!nas] = format(col[!nas], width = width(var))
          }
      }
      else if (class(col) == "Date") 
          col = as.character.Date(col, format = "%Y%m%d")
      else if (type(var) == "REAL" & !is.na(decimals(var))) {
          info = format.info(col[!nas])
          if (info[2] > decimals(var) | info[1] > width(var)) {
              message("reducing significance for variable ", name(var), 
                  " since the datamodel requires less significance")
              col = round(col, decimals(var))
          }
          if (width(var) == 1) 
              stop("width can not be 1 or smaller for REAL:", name(var))
          col[!nas] = format(round(col[!nas], decimals(var)), decimal.mark = decimal.mark, 
              digits = width(var) - 1, width = width(var), nsmall = decimals(var), 
              scientific = FALSE)
      }
      else if (type(var) == "REAL" & is.na(decimals(var))) {
          info = format.info(col[!nas])
          if (info[1] > width(var)) {
              message("reducing significance for variable ", name(var), 
                  " since the datamodel requires less significance")
              col = signif(col, width(var) - 1)
          }
          if (width(var) == 1) 
              stop("width can not be 1 or smaller for REAL:", name(var))
          col[!nas] = format(col[!nas], decimal.mark = decimal.mark, 
              width = width(var), digits = width(var) - 1, scientific = FALSE)
      }
      else if (is.logical(col)) {
          message("variable ", name(var), " is automatically converted from logical to integer")
          col = as.integer(col)
          col[!nas] = format(col[!nas], width = width(var))
      }
      else col[!nas] = format(col[!nas], decimal.mark = decimal.mark, 
          width = width(var), justify = justify, scientific = FALSE)
      col = replace_NA(col, width(var))
      nmax = format.info(col)[1]
      if (width(var) < nmax) {
          stop("width in datamodel smaller than number of characters of largest element for variable: ", 
              name(var))
      }
      if (width(var) > nmax) {
          stop("width in datamodel larger than number of characters of largest element for variable: ", 
              name(var))
      }
      return(col)
  })(dots[[1L]][[4L]], dots[[2L]][[4L]])`: width in datamodel smaller than number of characters of largest element for variable: date
  Backtrace:
       x
    1. \-blaise (local) expect_type_equal(df, "int") at test_types.R:34:2
    2.   +-base::eval(...) at test_types.R:20:2
    3.   | \-base::eval(...)
    4.   +-testthat::expect_silent(...)
    5.   | \-testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
    6.   |   +-testthat (local) .capture(...)
    7.   |   | +-withr::with_output_sink(...)
    8.   |   | | \-base::force(code)
    9.   |   | +-base::withCallingHandlers(...)
   10.   |   | \-base::withVisible(code)
   11.   |   \-rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   12.   \-blaise::write_fwf_blaise(`<df[,5]>`, datafile, blafile, model_name = "test")
   13.     \-blaise:::write_data(...)
   14.       \-blaise:::create_fixed_width_column(df, model, decimal.mark, justify)
   15.         +-base::as.data.frame(mapply(per_col, df, variables(model), SIMPLIFY = FALSE))
   16.         \-base::mapply(per_col, df, variables(model), SIMPLIFY = FALSE)
   17.           \-blaise (local) `<fn>`(dots[[1L]][[4L]], dots[[2L]][[4L]])
  -- Error (test_types.R:51:3): all types get read back identically for a tibble --
  Error in `(function (col, var) 
  {
      nas = is.na(col)
      if (is.factor(col)) {
          if (is.numbered_enum(levels(col))) {
              col = as.character(col)
              col[!nas] = format(col[!nas], width = width(var), 
                  justify = justify)
          }
          else {
              col = as.integer(col)
              col[!nas] = format(col[!nas], width = width(var))
          }
      }
      else if (class(col) == "Date") 
          col = as.character.Date(col, format = "%Y%m%d")
      else if (type(var) == "REAL" & !is.na(decimals(var))) {
          info = format.info(col[!nas])
          if (info[2] > decimals(var) | info[1] > width(var)) {
              message("reducing significance for variable ", name(var), 
                  " since the datamodel requires less significance")
              col = round(col, decimals(var))
          }
          if (width(var) == 1) 
              stop("width can not be 1 or smaller for REAL:", name(var))
          col[!nas] = format(round(col[!nas], decimals(var)), decimal.mark = decimal.mark, 
              digits = width(var) - 1, width = width(var), nsmall = decimals(var), 
              scientific = FALSE)
      }
      else if (type(var) == "REAL" & is.na(decimals(var))) {
          info = format.info(col[!nas])
          if (info[1] > width(var)) {
              message("reducing significance for variable ", name(var), 
                  " since the datamodel requires less significance")
              col = signif(col, width(var) - 1)
          }
          if (width(var) == 1) 
              stop("width can not be 1 or smaller for REAL:", name(var))
          col[!nas] = format(col[!nas], decimal.mark = decimal.mark, 
              width = width(var), digits = width(var) - 1, scientific = FALSE)
      }
      else if (is.logical(col)) {
          message("variable ", name(var), " is automatically converted from logical to integer")
          col = as.integer(col)
          col[!nas] = format(col[!nas], width = width(var))
      }
      else col[!nas] = format(col[!nas], decimal.mark = decimal.mark, 
          width = width(var), justify = justify, scientific = FALSE)
      col = replace_NA(col, width(var))
      nmax = format.info(col)[1]
      if (width(var) < nmax) {
          stop("width in datamodel smaller than number of characters of largest element for variable: ", 
              name(var))
      }
      if (width(var) > nmax) {
          stop("width in datamodel larger than number of characters of largest element for variable: ", 
              name(var))
      }
      return(col)
  })(dots[[1L]][[4L]], dots[[2L]][[4L]])`: width in datamodel smaller than number of characters of largest element for variable: date
  Backtrace:
       x
    1. \-blaise (local) expect_type_equal(df, "int") at test_types.R:51:2
    2.   +-base::eval(...) at test_types.R:20:2
    3.   | \-base::eval(...)
    4.   +-testthat::expect_silent(...)
    5.   | \-testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
    6.   |   +-testthat (local) .capture(...)
    7.   |   | +-withr::with_output_sink(...)
    8.   |   | | \-base::force(code)
    9.   |   | +-base::withCallingHandlers(...)
   10.   |   | \-base::withVisible(code)
   11.   |   \-rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   12.   \-blaise::write_fwf_blaise(`<tibble[,5]>`, datafile, blafile, model_name = "test")
   13.     \-blaise:::write_data(...)
   14.       \-blaise:::create_fixed_width_column(df, model, decimal.mark, justify)
   15.         +-base::as.data.frame(mapply(per_col, df, variables(model), SIMPLIFY = FALSE))
   16.         \-base::mapply(per_col, df, variables(model), SIMPLIFY = FALSE)
   17.           \-blaise (local) `<fn>`(dots[[1L]][[4L]], dots[[2L]][[4L]])
  -- Error (test_types.R:78:3): all types get read back identically with NA ------
  Error in `(function (col, var) 
  {
      nas = is.na(col)
      if (is.factor(col)) {
          if (is.numbered_enum(levels(col))) {
              col = as.character(col)
              col[!nas] = format(col[!nas], width = width(var), 
                  justify = justify)
          }
          else {
              col = as.integer(col)
              col[!nas] = format(col[!nas], width = width(var))
          }
      }
      else if (class(col) == "Date") 
          col = as.character.Date(col, format = "%Y%m%d")
      else if (type(var) == "REAL" & !is.na(decimals(var))) {
          info = format.info(col[!nas])
          if (info[2] > decimals(var) | info[1] > width(var)) {
              message("reducing significance for variable ", name(var), 
                  " since the datamodel requires less significance")
              col = round(col, decimals(var))
          }
          if (width(var) == 1) 
              stop("width can not be 1 or smaller for REAL:", name(var))
          col[!nas] = format(round(col[!nas], decimals(var)), decimal.mark = decimal.mark, 
              digits = width(var) - 1, width = width(var), nsmall = decimals(var), 
              scientific = FALSE)
      }
      else if (type(var) == "REAL" & is.na(decimals(var))) {
          info = format.info(col[!nas])
          if (info[1] > width(var)) {
              message("reducing significance for variable ", name(var), 
                  " since the datamodel requires less significance")
              col = signif(col, width(var) - 1)
          }
          if (width(var) == 1) 
              stop("width can not be 1 or smaller for REAL:", name(var))
          col[!nas] = format(col[!nas], decimal.mark = decimal.mark, 
              width = width(var), digits = width(var) - 1, scientific = FALSE)
      }
      else if (is.logical(col)) {
          message("variable ", name(var), " is automatically converted from logical to integer")
          col = as.integer(col)
          col[!nas] = format(col[!nas], width = width(var))
      }
      else col[!nas] = format(col[!nas], decimal.mark = decimal.mark, 
          width = width(var), justify = justify, scientific = FALSE)
      col = replace_NA(col, width(var))
      nmax = format.info(col)[1]
      if (width(var) < nmax) {
          stop("width in datamodel smaller than number of characters of largest element for variable: ", 
              name(var))
      }
      if (width(var) > nmax) {
          stop("width in datamodel larger than number of characters of largest element for variable: ", 
              name(var))
      }
      return(col)
  })(dots[[1L]][[4L]], dots[[2L]][[4L]])`: width in datamodel smaller than number of characters of largest element for variable: date
  Backtrace:
       x
    1. \-blaise (local) expect_type_equal(df, "int") at test_types.R:78:2
    2.   +-base::eval(...) at test_types.R:20:2
    3.   | \-base::eval(...)
    4.   +-testthat::expect_silent(...)
    5.   | \-testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
    6.   |   +-testthat (local) .capture(...)
    7.   |   | +-withr::with_output_sink(...)
    8.   |   | | \-base::force(code)
    9.   |   | +-base::withCallingHandlers(...)
   10.   |   | \-base::withVisible(code)
   11.   |   \-rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   12.   \-blaise::write_fwf_blaise(`<df[,5]>`, datafile, blafile, model_name = "test")
   13.     \-blaise:::write_data(...)
   14.       \-blaise:::create_fixed_width_column(df, model, decimal.mark, justify)
   15.         +-base::as.data.frame(mapply(per_col, df, variables(model), SIMPLIFY = FALSE))
   16.         \-base::mapply(per_col, df, variables(model), SIMPLIFY = FALSE)
   17.           \-blaise (local) `<fn>`(dots[[1L]][[4L]], dots[[2L]][[4L]])
  -- Failure (test_write_fwf_blaise_with_model.R:46:3): input_model passes an identical dataframe with common types --
  `write_fwf_blaise_with_model(df, datafile, blafile)` produced warnings.
  -- Error (test_write_fwf_blaise_with_model.R:249:3): Date is automatically casted to YYYYmmdd when string casting --
  Error in `(function (col, var) 
  {
      nas = is.na(col)
      if (is.factor(col)) {
          if (is.numbered_enum(levels(col))) {
              col = as.character(col)
              col[!nas] = format(col[!nas], width = width(var), 
                  justify = justify)
          }
          else {
              col = as.integer(col)
              col[!nas] = format(col[!nas], width = width(var))
          }
      }
      else if (class(col) == "Date") 
          col = as.character.Date(col, format = "%Y%m%d")
      else if (type(var) == "REAL" & !is.na(decimals(var))) {
          info = format.info(col[!nas])
          if (info[2] > decimals(var) | info[1] > width(var)) {
              message("reducing significance for variable ", name(var), 
                  " since the datamodel requires less significance")
              col = round(col, decimals(var))
          }
          if (width(var) == 1) 
              stop("width can not be 1 or smaller for REAL:", name(var))
          col[!nas] = format(round(col[!nas], decimals(var)), decimal.mark = decimal.mark, 
              digits = width(var) - 1, width = width(var), nsmall = decimals(var), 
              scientific = FALSE)
      }
      else if (type(var) == "REAL" & is.na(decimals(var))) {
          info = format.info(col[!nas])
          if (info[1] > width(var)) {
              message("reducing significance for variable ", name(var), 
                  " since the datamodel requires less significance")
              col = signif(col, width(var) - 1)
          }
          if (width(var) == 1) 
              stop("width can not be 1 or smaller for REAL:", name(var))
          col[!nas] = format(col[!nas], decimal.mark = decimal.mark, 
              width = width(var), digits = width(var) - 1, scientific = FALSE)
      }
      else if (is.logical(col)) {
          message("variable ", name(var), " is automatically converted from logical to integer")
          col = as.integer(col)
          col[!nas] = format(col[!nas], width = width(var))
      }
      else col[!nas] = format(col[!nas], decimal.mark = decimal.mark, 
          width = width(var), justify = justify, scientific = FALSE)
      col = replace_NA(col, width(var))
      nmax = format.info(col)[1]
      if (width(var) < nmax) {
          stop("width in datamodel smaller than number of characters of largest element for variable: ", 
              name(var))
      }
      if (width(var) > nmax) {
          stop("width in datamodel larger than number of characters of largest element for variable: ", 
              name(var))
      }
      return(col)
  })(dots[[1L]][[1L]], dots[[2L]][[1L]])`: width in datamodel smaller than number of characters of largest element for variable: H
  Backtrace:
       x
    1. +-testthat::expect_silent(...) at test_write_fwf_blaise_with_model.R:249:2
    2. | \-testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
    3. |   +-testthat (local) .capture(...)
    4. |   | +-withr::with_output_sink(...)
    5. |   | | \-base::force(code)
    6. |   | +-base::withCallingHandlers(...)
    7. |   | \-base::withVisible(code)
    8. |   \-rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    9. \-blaise::write_fwf_blaise_with_model(df, datafile, input_model = blafile)
   10.   \-blaise:::write_data(...)
   11.     \-blaise:::create_fixed_width_column(df, model, decimal.mark, justify)
   12.       +-base::as.data.frame(mapply(per_col, df, variables(model), SIMPLIFY = FALSE))
   13.       \-base::mapply(per_col, df, variables(model), SIMPLIFY = FALSE)
   14.         \-blaise (local) `<fn>`(dots[[1L]][[1L]], dots[[2L]][[1L]])
  -- Error (test_write_fwf_blaise_with_model.R:286:3): types are converted properly and can be converted back without loss --
  Error in `(function (col, var) 
  {
      nas = is.na(col)
      if (is.factor(col)) {
          if (is.numbered_enum(levels(col))) {
              col = as.character(col)
              col[!nas] = format(col[!nas], width = width(var), 
                  justify = justify)
          }
          else {
              col = as.integer(col)
              col[!nas] = format(col[!nas], width = width(var))
          }
      }
      else if (class(col) == "Date") 
          col = as.character.Date(col, format = "%Y%m%d")
      else if (type(var) == "REAL" & !is.na(decimals(var))) {
          info = format.info(col[!nas])
          if (info[2] > decimals(var) | info[1] > width(var)) {
              message("reducing significance for variable ", name(var), 
                  " since the datamodel requires less significance")
              col = round(col, decimals(var))
          }
          if (width(var) == 1) 
              stop("width can not be 1 or smaller for REAL:", name(var))
          col[!nas] = format(round(col[!nas], decimals(var)), decimal.mark = decimal.mark, 
              digits = width(var) - 1, width = width(var), nsmall = decimals(var), 
              scientific = FALSE)
      }
      else if (type(var) == "REAL" & is.na(decimals(var))) {
          info = format.info(col[!nas])
          if (info[1] > width(var)) {
              message("reducing significance for variable ", name(var), 
                  " since the datamodel requires less significance")
              col = signif(col, width(var) - 1)
          }
          if (width(var) == 1) 
              stop("width can not be 1 or smaller for REAL:", name(var))
          col[!nas] = format(col[!nas], decimal.mark = decimal.mark, 
              width = width(var), digits = width(var) - 1, scientific = FALSE)
      }
      else if (is.logical(col)) {
          message("variable ", name(var), " is automatically converted from logical to integer")
          col = as.integer(col)
          col[!nas] = format(col[!nas], width = width(var))
      }
      else col[!nas] = format(col[!nas], decimal.mark = decimal.mark, 
          width = width(var), justify = justify, scientific = FALSE)
      col = replace_NA(col, width(var))
      nmax = format.info(col)[1]
      if (width(var) < nmax) {
          stop("width in datamodel smaller than number of characters of largest element for variable: ", 
              name(var))
      }
      if (width(var) > nmax) {
          stop("width in datamodel larger than number of characters of largest element for variable: ", 
              name(var))
      }
      return(col)
  })(dots[[1L]][[5L]], dots[[2L]][[5L]])`: width in datamodel smaller than number of characters of largest element for variable: H
  Backtrace:
       x
    1. +-testthat::expect_silent(...) at test_write_fwf_blaise_with_model.R:286:2
    2. | \-testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
    3. |   +-testthat (local) .capture(...)
    4. |   | +-withr::with_output_sink(...)
    5. |   | | \-base::force(code)
    6. |   | +-base::withCallingHandlers(...)
    7. |   | \-base::withVisible(code)
    8. |   \-rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    9. \-blaise::write_fwf_blaise_with_model(df, datafile, input_model = blafile)
   10.   \-blaise:::write_data(...)
   11.     \-blaise:::create_fixed_width_column(df, model, decimal.mark, justify)
   12.       +-base::as.data.frame(mapply(per_col, df, variables(model), SIMPLIFY = FALSE))
   13.       \-base::mapply(per_col, df, variables(model), SIMPLIFY = FALSE)
   14.         \-blaise (local) `<fn>`(dots[[1L]][[5L]], dots[[2L]][[5L]])
  -- Failure (test_write_fwf_blaise_with_model.R:383:3): input_model works with lower case or mixed case types --
  `write_fwf_blaise_with_model(df, datafile, blafile)` produced warnings.
  
  [ FAIL 7 | WARN 0 | SKIP 0 | PASS 364 ]
  Error: Test failures
  Execution halted