Running ‘testthat.R’ [2s/2s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(fy)
  > library(data.table)
  
  Attaching package: 'data.table'
  
  The following object is masked from 'package:base':
  
      %notin%
  
  > setDTthreads(1)
  > 
  > test_check("fy")
  Saving _problems/test-grattan-FY-72.R
  Saving _problems/test-is_fy-6.R
  Saving _problems/test-yr2fy-44.R
  Saving _problems/test_validate_fys-13.R
  Saving _problems/test_validate_fys-17.R
  Saving _problems/test_validate_fys-22.R
  Saving _problems/test_validate_fys-26.R
  Saving _problems/test_validate_fys-51.R
  [ FAIL 8 | WARN 0 | SKIP 3 | PASS 122 ]
  
  ══ Skipped tests (3) ═══════════════════════════════════════════════════════════
  • On CRAN (3): 'test-grattan-FY.R:59:3', 'test-range_fy2yr.R:13:3',
    'test_validate_fys.R:57:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-grattan-FY.R:72:3'): yr2fy and .yr2fy ──────────────────────────
  Error in ``[.data.table`(DT, , `:=`("res", .FUN(.BY[[1L]], ...)), by = "x")`: attempt access index 1/1 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─testthat::expect_identical(fy.year(x), .yr2fy(x)) at test-grattan-FY.R:72:3
   2. │ └─testthat::quasi_label(enquo(object), label)
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─fy (local) fy.year(x)
   5.   └─fy:::accel_repetitive_input(yr_ending, .yr2fy)
   6.     ├─DT[, `:=`("res", .FUN(.BY[[1L]], ...)), by = "x"]
   7.     └─data.table:::`[.data.table`(...)
  ── Error ('test-is_fy.R:6:3'): is_fy works ─────────────────────────────────────
  Error in ``[.data.table`(DT, , `:=`("res", .FUN(.BY[[1L]], ...)), by = "x")`: attempt access index 1/1 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─testthat::expect_true(...) at test-is_fy.R:6:3
   2. │ └─testthat::quasi_label(enquo(object), label)
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─fy::is_fy(c("2014-15", "2015-16", "2015-15"))
   5.   └─fy:::accel_repetitive_input(x, is_fy, THRESHOLD = 2L)
   6.     ├─DT[, `:=`("res", .FUN(.BY[[1L]], ...)), by = "x"]
   7.     └─data.table:::`[.data.table`(...)
  ── Error ('test-yr2fy.R:39:3'): accelerator ────────────────────────────────────
  Error in ``[.data.table`(DT, , `:=`("res", .FUN(.BY[[1L]], ...)), by = "x")`: attempt access index 1/1 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─fy:::expect_equal(...) at test-yr2fy.R:39:3
   2. │ └─base::inherits(object, "fy") at ./helper.R:6:3
   3. └─fy:::accel_repetitive_input(...)
   4.   ├─DT[, `:=`("res", .FUN(.BY[[1L]], ...)), by = "x"]
   5.   └─data.table:::`[.data.table`(...)
  ── Failure ('test_validate_fys.R:11:3'): Error handling ────────────────────────
  `validate_fys_permitted(...)` threw an error with unexpected message.
  Expected match: "contained invalid FYs."
  Actual message: "attempt access index 1/1 in VECTOR_ELT"
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test_validate_fys.R:11:3
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─fy::validate_fys_permitted(...)
    7.   └─fy::is_fy(fy.year)
    8.     └─fy:::accel_repetitive_input(x, is_fy, THRESHOLD = 2L)
    9.       ├─DT[, `:=`("res", .FUN(.BY[[1L]], ...)), by = "x"]
   10.       └─data.table:::`[.data.table`(...)
  ── Failure ('test_validate_fys.R:15:3'): Error handling ────────────────────────
  `validate_fys_permitted(zzz, c("2015-16", "2016-17"))` threw an error with unexpected message.
  Expected match: "`zzz` contained invalid entry 2015-17 at position 2."
  Actual message: "attempt access index 1/1 in VECTOR_ELT"
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test_validate_fys.R:15:3
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─fy::validate_fys_permitted(zzz, c("2015-16", "2016-17"))
    7.   └─fy::is_fy(fy.year)
    8.     └─fy:::accel_repetitive_input(x, is_fy, THRESHOLD = 2L)
    9.       ├─DT[, `:=`("res", .FUN(.BY[[1L]], ...)), by = "x"]
   10.       └─data.table:::`[.data.table`(...)
  ── Failure ('test_validate_fys.R:20:3'): Error handling ────────────────────────
  `validate_fys_permitted(zzz, yyy)` threw an error with unexpected message.
  Expected match: "`zzz = 2017-18` was not within the allowed range: 2015-16 <= fy.year <= 2016-17"
  Actual message: "attempt access index 1/1 in VECTOR_ELT"
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test_validate_fys.R:20:3
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─fy::validate_fys_permitted(zzz, yyy)
    7.   └─fy::is_fy(fy.year)
    8.     └─fy:::accel_repetitive_input(x, is_fy, THRESHOLD = 2L)
    9.       ├─DT[, `:=`("res", .FUN(.BY[[1L]], ...)), by = "x"]
   10.       └─data.table:::`[.data.table`(...)
  ── Failure ('test_validate_fys.R:23:3'): Error handling ────────────────────────
  `validate_fys_permitted(...)` threw an error with unexpected message.
  Expected match: "were not within the allowed range: 2015-16 <= fy.year <= 2016-17"
  Actual message: "attempt access index 1/1 in VECTOR_ELT"
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test_validate_fys.R:23:3
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─fy::validate_fys_permitted(...)
    7.   └─fy::is_fy(fy.year)
    8.     └─fy:::accel_repetitive_input(x, is_fy, THRESHOLD = 2L)
    9.       ├─DT[, `:=`("res", .FUN(.BY[[1L]], ...)), by = "x"]
   10.       └─data.table:::`[.data.table`(...)
  ── Error ('test_validate_fys.R:50:3'): validate permitted years ────────────────
  Error in ``[.data.table`(DT, , `:=`("res", .FUN(.BY[[1L]], ...)), by = "x")`: attempt access index 1/1 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─testthat::expect_true(...) at test_validate_fys.R:50:3
   2. │ └─testthat::quasi_label(enquo(object), label)
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. ├─base::inherits(...)
   5. └─fy::validate_fys_permitted(v, permitted_fys = yr2fy(1950:2050))
   6.   └─fy::is_fy(fy.year)
   7.     └─fy:::accel_repetitive_input(x, is_fy, THRESHOLD = 2L)
   8.       ├─DT[, `:=`("res", .FUN(.BY[[1L]], ...)), by = "x"]
   9.       └─data.table:::`[.data.table`(...)
  
  [ FAIL 8 | WARN 0 | SKIP 3 | PASS 122 ]
  Error:
  ! Test failures.
  Execution halted