Running ‘spelling.R’ [0s/1s]
  Running ‘testthat.R’ [10s/19s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(sdcLog)
  > 
  > test_check("sdcLog")
  
  > 1 + 1
  [1] 2
  
  > sdc_log(script_2, conn, append = TRUE)
  Log file for 'script_2.R' written to 'file connection'.
  [ FAIL 17 | WARN 5 | SKIP 0 | PASS 170 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-sdc_descriptives.R:26:3'): sdc_descriptives works in simple cases ──
  Error in ``[.data.table`(dt, id_na == TRUE, list(value_share_na = value_share), 
      keyby = by)`: 'by' or 'keyby' must evaluate to a vector or a list of vectors (where 'list' includes data.table and data.frame which are lists, too)
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(...) at test-sdc_descriptives.R:26:2
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─sdcLog::sdc_descriptives(sdc_descriptives_DT, "id", "val_1")
   5.   └─sdcLog:::check_dominance(data, id_var, val_var, by)
   6.     ├─dt[id_na == TRUE, list(value_share_na = value_share), keyby = by]
   7.     └─data.table:::`[.data.table`(...)
  ── Error ('test-sdc_descriptives.R:181:3'): zeros are handles correctly ────────
  Error in ``[.data.table`(dt, id_na == TRUE, list(value_share_na = value_share), 
      keyby = by)`: 'by' or 'keyby' must evaluate to a vector or a list of vectors (where 'list' includes data.table and data.frame which are lists, too)
  Backtrace:
       ▆
    1. ├─testthat::expect_message(...) at test-sdc_descriptives.R:181:2
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. ├─testthat::expect_equal(...)
    8. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
    9. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   10. └─sdcLog::sdc_descriptives(sdc_descriptives_DT, "id", "val_2")
   11.   └─sdcLog:::check_dominance(data, id_var, val_var, by)
   12.     ├─dt[id_na == TRUE, list(value_share_na = value_share), keyby = by]
   13.     └─data.table:::`[.data.table`(...)
  ── Error ('test-sdc_descriptives.R:314:3'): missing ID's are handled correctly (simple case) ──
  Error in ``[.data.table`(dt, id_na == TRUE, list(value_share_na = value_share), 
      keyby = by)`: 'by' or 'keyby' must evaluate to a vector or a list of vectors (where 'list' includes data.table and data.frame which are lists, too)
  Backtrace:
       ▆
    1. ├─testthat::expect_warning(...) at test-sdc_descriptives.R:314:2
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. ├─testthat::expect_equal(...)
    8. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
    9. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   10. └─sdcLog::sdc_descriptives(DT_filled[seq(2, 20, 2)], "id_na", "val_1")
   11.   └─sdcLog:::check_dominance(data, id_var, val_var, by)
   12.     ├─dt[id_na == TRUE, list(value_share_na = value_share), keyby = by]
   13.     └─data.table:::`[.data.table`(...)
  ── Error ('test-sdc_descriptives.R:493:3'): #77 is fixed ───────────────────────
  Error in ``[.data.table`(dt, id_na == TRUE, list(value_share_na = value_share), 
      keyby = by)`: 'by' or 'keyby' must evaluate to a vector or a list of vectors (where 'list' includes data.table and data.frame which are lists, too)
  Backtrace:
      ▆
   1. ├─testthat::capture_warnings(...) at test-sdc_descriptives.R:493:2
   2. │ └─base::withCallingHandlers(...)
   3. ├─testthat::expect_equal(...)
   4. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   5. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   6. └─sdcLog::sdc_descriptives(df, "id", val_var = "val")
   7.   └─sdcLog:::check_dominance(data, id_var, val_var, by)
   8.     ├─dt[id_na == TRUE, list(value_share_na = value_share), keyby = by]
   9.     └─data.table:::`[.data.table`(...)
  ── Error ('test-sdc_extreme.R:33:5'): sdc_min_max() works in simple case ───────
  Error in ``[.data.table`(dt, id_na == TRUE, list(value_share_na = value_share), 
      keyby = by)`: 'by' or 'keyby' must evaluate to a vector or a list of vectors (where 'list' includes data.table and data.frame which are lists, too)
  Backtrace:
      ▆
   1. ├─testthat::expect_identical(...) at test-sdc_extreme.R:33:4
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─sdcLog::sdc_min_max(...)
   5.   └─sdcLog:::find_SD(...)
   6.     └─sdcLog:::find_SD_problems(...)
   7.       └─sdcLog:::check_dominance(SD, id_var, val_var, by)
   8.         ├─dt[id_na == TRUE, list(value_share_na = value_share), keyby = by]
   9.         └─data.table:::`[.data.table`(...)
  ── Error ('test-sdc_extreme.R:58:5'): sdc_min_max() produces no result in case of sd_overlap due to dominance ──
  Error in ``[.data.table`(dt, id_na == TRUE, list(value_share_na = value_share), 
      keyby = by)`: 'by' or 'keyby' must evaluate to a vector or a list of vectors (where 'list' includes data.table and data.frame which are lists, too)
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(...) at test-sdc_extreme.R:58:4
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─sdcLog::sdc_min_max(extreme_test_dt, "id", "val_2")
   5.   └─sdcLog:::find_SD(...)
   6.     └─sdcLog:::find_SD_problems(...)
   7.       └─sdcLog:::check_dominance(SD, id_var, val_var, by)
   8.         ├─dt[id_na == TRUE, list(value_share_na = value_share), keyby = by]
   9.         └─data.table:::`[.data.table`(...)
  ── Error ('test-sdc_extreme.R:84:5'): sdc_min_max() produces no result in case of sd_overlap ──
  Error in ``[.data.table`(dt, id_na == TRUE, list(value_share_na = value_share), 
      keyby = by)`: 'by' or 'keyby' must evaluate to a vector or a list of vectors (where 'list' includes data.table and data.frame which are lists, too)
  Backtrace:
      ▆
   1. ├─testthat::expect_identical(...) at test-sdc_extreme.R:84:4
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─sdcLog::sdc_min_max(extreme_test_dt, "id", "val_3")
   5.   └─sdcLog:::find_SD(...)
   6.     └─sdcLog:::find_SD_problems(...)
   7.       └─sdcLog:::check_dominance(SD, id_var, val_var, by)
   8.         ├─dt[id_na == TRUE, list(value_share_na = value_share), keyby = by]
   9.         └─data.table:::`[.data.table`(...)
  ── Error ('test-sdc_extreme.R:254:5'): sdc_min_max() does not enter an infinite loop ──
  Error in ``[.data.table`(dt, id_na == TRUE, list(value_share_na = value_share), 
      keyby = by)`: 'by' or 'keyby' must evaluate to a vector or a list of vectors (where 'list' includes data.table and data.frame which are lists, too)
  Backtrace:
      ▆
   1. ├─testthat::expect_identical(...) at test-sdc_extreme.R:254:4
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─sdcLog::sdc_min_max(extreme_test_dt[1:5], "id", "val_2")
   5.   └─sdcLog:::find_SD(...)
   6.     └─sdcLog:::find_SD_problems(...)
   7.       └─sdcLog:::check_dominance(SD, id_var, val_var, by)
   8.         ├─dt[id_na == TRUE, list(value_share_na = value_share), keyby = by]
   9.         └─data.table:::`[.data.table`(...)
  ── Failure ('test-sdc_log.R:27:5'): sdc_log() works correctly with log files ───
  readLines(tf)[-exclude] (`actual`) not identical to gsub("✓", "v", readLines(log))[-exclude] (`expected`).
  
  actual[2:4] vs expected[2:28]
    ""
    "> data(\"sdc_descriptives_DT\")"
    ""
    "> sdc_descriptives(data = sdc_descriptives_DT, id_var = \"id\", val_var = \"val_1\")"
  + "-------------------------------------------------- SDC results (descriptives) --"
  + "OPTIONS: sdc.n_ids: 5 | sdc.n_ids_dominance: 2 | sdc.share_dominance: 0.85"
  + "SETTINGS: id_var: id | val_var: val_1 | zero_as_NA: FALSE"
  + "--------------------------------------------------------------------------------"
  + ""
  + "> data(\"sdc_min_max_DT\")"
  + ""
  and 17 more ...
  ── Failure ('test-sdc_log.R:28:5'): sdc_log() works correctly with log files ───
  readLines\(tf\)\[exclude\] does not match "Output complies to RDC rules.".
  Actual values:
  * <NA>
  * <NA>
  Backtrace:
      ▆
   1. └─testthat::expect_match(readLines(tf)[exclude], "Output complies to RDC rules.") at test-sdc_log.R:28:4
   2.   └─testthat:::expect_match_(...)
  ── Failure ('test-sdc_log.R:46:5'): sdc_log() works correctly with connections ──
  readLines(tf_conn)[-exclude] (`actual`) not identical to gsub("✓", "v", readLines(log))[-exclude] (`expected`).
  
  actual[2:4] vs expected[2:28]
    ""
    "> data(\"sdc_descriptives_DT\")"
    ""
    "> sdc_descriptives(data = sdc_descriptives_DT, id_var = \"id\", val_var = \"val_1\")"
  + "-------------------------------------------------- SDC results (descriptives) --"
  + "OPTIONS: sdc.n_ids: 5 | sdc.n_ids_dominance: 2 | sdc.share_dominance: 0.85"
  + "SETTINGS: id_var: id | val_var: val_1 | zero_as_NA: FALSE"
  + "--------------------------------------------------------------------------------"
  + ""
  + "> data(\"sdc_min_max_DT\")"
  + ""
  and 17 more ...
  ── Failure ('test-sdc_log.R:47:5'): sdc_log() works correctly with connections ──
  readLines\(tf_conn\)\[exclude\] does not match "Output complies to RDC rules.".
  Actual values:
  * <NA>
  * <NA>
  Backtrace:
      ▆
   1. └─testthat::expect_match(readLines(tf_conn)[exclude], "Output complies to RDC rules.") at test-sdc_log.R:47:4
   2.   └─testthat:::expect_match_(...)
  ── Error ('test-sdc_min_max.R:33:5'): sdc_min_max() works in simple case ───────
  Error in ``[.data.table`(dt, id_na == TRUE, list(value_share_na = value_share), 
      keyby = by)`: 'by' or 'keyby' must evaluate to a vector or a list of vectors (where 'list' includes data.table and data.frame which are lists, too)
  Backtrace:
      ▆
   1. ├─testthat::expect_identical(...) at test-sdc_min_max.R:33:4
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─sdcLog::sdc_min_max(...)
   5.   └─sdcLog:::find_SD(...)
   6.     └─sdcLog:::find_SD_problems(...)
   7.       └─sdcLog:::check_dominance(SD, id_var, val_var, by)
   8.         ├─dt[id_na == TRUE, list(value_share_na = value_share), keyby = by]
   9.         └─data.table:::`[.data.table`(...)
  ── Error ('test-sdc_min_max.R:58:5'): sdc_min_max() produces no result in case of sd_overlap due to dominance ──
  Error in ``[.data.table`(dt, id_na == TRUE, list(value_share_na = value_share), 
      keyby = by)`: 'by' or 'keyby' must evaluate to a vector or a list of vectors (where 'list' includes data.table and data.frame which are lists, too)
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(...) at test-sdc_min_max.R:58:4
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─sdcLog::sdc_min_max(extreme_test_dt, "id", "val_2")
   5.   └─sdcLog:::find_SD(...)
   6.     └─sdcLog:::find_SD_problems(...)
   7.       └─sdcLog:::check_dominance(SD, id_var, val_var, by)
   8.         ├─dt[id_na == TRUE, list(value_share_na = value_share), keyby = by]
   9.         └─data.table:::`[.data.table`(...)
  ── Error ('test-sdc_min_max.R:84:5'): sdc_min_max() produces no result in case of sd_overlap ──
  Error in ``[.data.table`(dt, id_na == TRUE, list(value_share_na = value_share), 
      keyby = by)`: 'by' or 'keyby' must evaluate to a vector or a list of vectors (where 'list' includes data.table and data.frame which are lists, too)
  Backtrace:
      ▆
   1. ├─testthat::expect_identical(...) at test-sdc_min_max.R:84:4
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─sdcLog::sdc_min_max(extreme_test_dt, "id", "val_3")
   5.   └─sdcLog:::find_SD(...)
   6.     └─sdcLog:::find_SD_problems(...)
   7.       └─sdcLog:::check_dominance(SD, id_var, val_var, by)
   8.         ├─dt[id_na == TRUE, list(value_share_na = value_share), keyby = by]
   9.         └─data.table:::`[.data.table`(...)
  ── Error ('test-sdc_min_max.R:261:5'): sdc_min_max() does not enter an infinite loop ──
  Error in ``[.data.table`(dt, id_na == TRUE, list(value_share_na = value_share), 
      keyby = by)`: 'by' or 'keyby' must evaluate to a vector or a list of vectors (where 'list' includes data.table and data.frame which are lists, too)
  Backtrace:
      ▆
   1. ├─testthat::expect_identical(...) at test-sdc_min_max.R:261:4
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─sdcLog::sdc_min_max(extreme_test_dt[1:5], "id", "val_2")
   5.   └─sdcLog:::find_SD(...)
   6.     └─sdcLog:::find_SD_problems(...)
   7.       └─sdcLog:::check_dominance(SD, id_var, val_var, by)
   8.         ├─dt[id_na == TRUE, list(value_share_na = value_share), keyby = by]
   9.         └─data.table:::`[.data.table`(...)
  ── Error ('test-sdc_min_max.R:287:5'): argument fill_id_var works ──────────────
  Error in ``[.data.table`(data, i = !is.na(get(id_var)) & !is.na(get(val_var)), 
      j = list(distinct_ids = data.table::uniqueN(get(id_var))), 
      keyby = by)`: 'by' or 'keyby' must evaluate to a vector or a list of vectors (where 'list' includes data.table and data.frame which are lists, too)
  Backtrace:
      ▆
   1. ├─testthat::expect_identical(...) at test-sdc_min_max.R:287:4
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─sdcLog::sdc_min_max(extreme_test_dt, "id_na", val_var = "val_1")
   5.   └─sdcLog:::find_SD(...)
   6.     └─sdcLog:::find_SD_problems(...)
   7.       └─sdcLog:::check_distinct_ids(SD, id_var, val_var, by)
   8.         ├─...[]
   9.         └─data.table:::`[.data.table`(...)
  
  [ FAIL 17 | WARN 5 | SKIP 0 | PASS 170 ]
  Error: Test failures
  Execution halted