Running ‘testthat.R’ [60s/122s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(klassR)
  > 
  > test_check("klassR")
  Saving _problems/test_ApplyKlass-63.R
  Saving _problems/test_ApplyKlass-84.R
  Saving _problems/test_ApplyKlass-109.R
  Saving _problems/test_ApplyKlass-134.R
  Saving _problems/test_ApplyKlass-185.R
  Saving _problems/test_GetKlass-99.R
  Connection failed with error code 404
  Saving _problems/test_GetKlass-166.R
  [ FAIL 7 | WARN 0 | SKIP 0 | PASS 78 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test_ApplyKlass.R:63:3'): Check levelCheck for numerical codes ──────
  Error: parse error: premature EOF
                                         {"codes":[{"code":"01","parentC
                       (right here) ------^
  
  Backtrace:
      ▆
   1. └─klassR::get_klass(6, date = "2020-01-01") at test_ApplyKlass.R:63:3
   2.   └─jsonlite::fromJSON(klass_text, flatten = TRUE)
   3.     └─jsonlite:::parse_and_simplify(...)
   4.       └─jsonlite:::parseJSON(txt, bigint_as_char)
   5.         └─jsonlite:::parse_string(txt, bigint_as_char)
  ── Error ('test_ApplyKlass.R:80:3'): apply_klass can return a variant classification ──
  Error: parse error: premature EOF
                                         {"name":"Næringsgruppering 17 
                       (right here) ------^
  
  Backtrace:
      ▆
   1. └─klassR::apply_klass(...) at test_ApplyKlass.R:80:3
   2.   └─klassR::get_klass(...)
   3.     └─klassR:::get_variant_name(variant)
   4.       └─jsonlite::fromJSON(variant_text, flatten = TRUE)
   5.         └─jsonlite:::parse_and_simplify(...)
   6.           └─jsonlite:::parseJSON(txt, bigint_as_char)
   7.             └─jsonlite:::parse_string(txt, bigint_as_char)
  ── Error ('test_ApplyKlass.R:102:5'): apply_klass works for variant classification with Norwegian characters in the variant name ──
  Error: parse error: premature EOF
                                         {"codes":[{"code":"01","parentC
                       (right here) ------^
  
  Backtrace:
      ▆
   1. └─klassR::apply_klass(...) at test_ApplyKlass.R:102:5
   2.   └─klassR::get_klass(...)
   3.     └─jsonlite::fromJSON(klass_text, flatten = TRUE)
   4.       └─jsonlite:::parse_and_simplify(...)
   5.         └─jsonlite:::parseJSON(txt, bigint_as_char)
   6.           └─jsonlite:::parse_string(txt, bigint_as_char)
  ── Error ('test_ApplyKlass.R:131:3'): Nace classification with missing formatting ──
  Error: parse error: premature EOF
                                         {"codes":[{"code":"01","parentC
                       (right here) ------^
  
  Backtrace:
       ▆
    1. ├─testthat::expect_warning(...) at test_ApplyKlass.R:131:3
    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. └─klassR::apply_klass(dat, classification = 6, date = "2024-01-01")
    8.   └─klassR::get_klass(...)
    9.     └─jsonlite::fromJSON(klass_text, flatten = TRUE)
   10.       └─jsonlite:::parse_and_simplify(...)
   11.         └─jsonlite:::parseJSON(txt, bigint_as_char)
   12.           └─jsonlite:::parse_string(txt, bigint_as_char)
  ── Error ('test_ApplyKlass.R:182:3'): Municipality classification with missing formatting ──
  Error: parse error: premature EOF
                                         {"codes":[{"code":"01","parentC
                       (right here) ------^
  
  Backtrace:
       ▆
    1. ├─testthat::expect_warning(...) at test_ApplyKlass.R:182:3
    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. └─klassR::apply_klass(dat, classification = 6, date = "2024-01-01")
    8.   └─klassR::get_klass(...)
    9.     └─jsonlite::fromJSON(klass_text, flatten = TRUE)
   10.       └─jsonlite:::parse_and_simplify(...)
   11.         └─jsonlite:::parseJSON(txt, bigint_as_char)
   12.           └─jsonlite:::parse_string(txt, bigint_as_char)
  ── Error ('test_GetKlass.R:99:3'): get_klass returns a valid variant including ones with spaces in name ──
  Error: parse error: premature EOF
                                         {"codes":[{"code":"01","parentC
                       (right here) ------^
  
  Backtrace:
      ▆
   1. └─klassR::get_klass(6, variant = 1616, date = "2021-01-02") at test_GetKlass.R:99:3
   2.   └─jsonlite::fromJSON(klass_text, flatten = TRUE)
   3.     └─jsonlite:::parse_and_simplify(...)
   4.       └─jsonlite:::parseJSON(txt, bigint_as_char)
   5.         └─jsonlite:::parse_string(txt, bigint_as_char)
  ── Error ('test_GetKlass.R:166:3'): get_klass returns valid dates for a date range ──
  Error: parse error: premature EOF
                                         {"codes":[{"code":"01","parentC
                       (right here) ------^
  
  Backtrace:
      ▆
   1. └─klassR::get_klass(6, variant = 1616, date = c("2020-01-01", "2024-01-02")) at test_GetKlass.R:166:3
   2.   └─jsonlite::fromJSON(klass_text, flatten = TRUE)
   3.     └─jsonlite:::parse_and_simplify(...)
   4.       └─jsonlite:::parseJSON(txt, bigint_as_char)
   5.         └─jsonlite:::parse_string(txt, bigint_as_char)
  
  [ FAIL 7 | WARN 0 | SKIP 0 | PASS 78 ]
  Error:
  ! Test failures.
  Execution halted