Running ‘testthat.R’ [6s/11s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/tests.html
  > # * https://testthat.r-lib.org/reference/test_package.html#special-files
  > 
  > library(testthat)
  > library(TheOpenAIR)
  > 
  > test_check("TheOpenAIR")
  Rows: 3 Columns: 3
  -- Column specification --------------------------------------------------------
  Delimiter: ","
  chr (1): Name
  dbl (2): Age, Height
  
  i Use `spec()` to retrieve the full column specification for this data.
  i Specify the column types or set `show_col_types = FALSE` to quiet this message.
  Rows: 3 Columns: 3
  -- Column specification --------------------------------------------------------
  Delimiter: ","
  chr (1): Name
  dbl (2): Age, Height
  
  i Use `spec()` to retrieve the full column specification for this data.
  i Specify the column types or set `show_col_types = FALSE` to quiet this message.
  Empty string provided.
  Empty string provided.
  [ FAIL 1 | WARN 0 | SKIP 20 | PASS 45 ]
  
  ══ Skipped tests (20) ══════════════════════════════════════════════════════════
  • API key not set, skipping test. (15): 'test-%c%.R:11:3',
    'test-add_roxygen.R:43:5', 'test-chat.R:10:3', 'test-chat_completion.R:33:3',
    'test-extract_blocks.R:48:3', 'test-extract_entities.R:8:3',
    'test-messages.R:26:3', 'test-nested_to_pipe.R:39:5',
    'test-parse_response.R:42:3', 'test-python_to_r.R:31:3',
    'test-r_to_python.R:39:3', 'test-refactor.R:40:5',
    'test-references_to_bibtex.R:18:3', 'test-regenerate.R:29:3',
    'test-write_test.R:28:5'
  • Python not installed, skipping test. (1): 'test-is_python.R:2:3'
  • empty test (4): 'test-df_to_csv.R:2:1', 'test-is_json.R:3:1',
    'test-is_xml.R:3:1', 'test-read_text.R:30:1'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-count_tokens.R:12:3'): count_tokens() correctly counts the number of tokens in a text string ──
  Error in ``[.data.table`(tokens_dt, , .N, by = NULL)`: '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(count_tokens(""), 0) at test-count_tokens.R:12:3
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─TheOpenAIR::count_tokens("")
   5.   ├─tokens_dt[, .N, by = NULL]
   6.   └─data.table:::`[.data.table`(tokens_dt, , .N, by = NULL)
  
  [ FAIL 1 | WARN 0 | SKIP 20 | PASS 45 ]
  Error: Test failures
  Execution halted