Running ‘testthat.R’ [7s/14s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(klassR)
  > 
  > test_check("klassR")
  Connection failed with error code 503
  Connection failed with error code 503
  Connection failed with error code 503
  Connection failed with error code 503
  Connection failed with error code 503
  Connection failed with error code 503
  Connection failed with error code 503
  Connection failed with error code 503
  Connection failed with error code 503
  Connection failed with error code 503
  Connection failed with error code 503
  Connection failed with error code 503
  Connection failed with error code 503
  Connection failed with error code 503
  Connection failed with error code 503
  Connection failed with error code 503
  Connection failed with error code 503
  Connection failed with error code 503
  Connection failed with error code 503
  Connection failed with error code 503
  Connection failed with error code 503
  Connection failed with error code 503
  Connection failed with error code 503
  Connection failed with error code 503
  Connection failed with error code 503
  Connection failed with error code 503
  Connection failed with error code 503
  Connection failed with error code 503
  Connection failed with error code 503
  Connection failed with error code 503
  [ FAIL 35 | WARN 6 | SKIP 0 | PASS 28 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-UpdateKlass.R:5:3'): update_klass gir riktig resultat ved enkle endringer ──
  Error in `dplyr::filter(., changeOccurred == "2020-01-01")`: i In argument: `changeOccurred == "2020-01-01"`.
  Caused by error:
  ! object 'changeOccurred' not found
  Backtrace:
       ▆
    1. ├─... %>% dplyr::select(oldCode, newCode, changeOccurred) at test-UpdateKlass.R:5:3
    2. ├─dplyr::select(., oldCode, newCode, changeOccurred)
    3. ├─dplyr::ungroup(.)
    4. ├─dplyr::filter(., dplyr::n() == 1)
    5. ├─dplyr::group_by(., newCode)
    6. ├─dplyr::filter(., dplyr::n() == 1)
    7. ├─dplyr::group_by(., oldCode)
    8. ├─dplyr::filter(., changeOccurred == "2020-01-01")
    9. ├─dplyr:::filter.data.frame(., changeOccurred == "2020-01-01")
   10. │ └─dplyr:::filter_rows(.data, dots, by)
   11. │   └─dplyr:::filter_eval(...)
   12. │     ├─base::withCallingHandlers(...)
   13. │     └─mask$eval_all_filter(dots, env_filter)
   14. │       └─dplyr (local) eval()
   15. └─base::.handleSimpleError(...)
   16.   └─dplyr (local) h(simpleError(msg, call))
   17.     └─rlang::abort(message, class = error_class, parent = parent, call = error_call)
  ── Error ('test-UpdateKlass.R:37:3'): update_klass gir riktig resultat ved sammenslåtte koder ──
  Error in `dplyr::filter(., changeOccurred == "1964-01-01")`: i In argument: `changeOccurred == "1964-01-01"`.
  Caused by error:
  ! object 'changeOccurred' not found
  Backtrace:
       ▆
    1. ├─... %>% dplyr::filter(dplyr::n() > 1) at test-UpdateKlass.R:37:3
    2. ├─dplyr::filter(., dplyr::n() > 1)
    3. ├─dplyr::group_by(., newCode)
    4. ├─dplyr::filter(., dplyr::n() == 1)
    5. ├─dplyr::group_by(., oldCode, changeOccurred)
    6. ├─dplyr::filter(., changeOccurred == "1964-01-01")
    7. ├─dplyr:::filter.data.frame(., changeOccurred == "1964-01-01")
    8. │ └─dplyr:::filter_rows(.data, dots, by)
    9. │   └─dplyr:::filter_eval(...)
   10. │     ├─base::withCallingHandlers(...)
   11. │     └─mask$eval_all_filter(dots, env_filter)
   12. │       └─dplyr (local) eval()
   13. └─base::.handleSimpleError(...)
   14.   └─dplyr (local) h(simpleError(msg, call))
   15.     └─rlang::abort(message, class = error_class, parent = parent, call = error_call)
  ── Error ('test-UpdateKlass.R:95:3'): update_klass gir riktig resultat ved delte koder ──
  Error in `dplyr::filter(., changeOccurred == "1964-01-01")`: i In argument: `changeOccurred == "1964-01-01"`.
  Caused by error:
  ! object 'changeOccurred' not found
  Backtrace:
       ▆
    1. ├─... %>% dplyr::select(oldCode, newCode, changeOccurred) at test-UpdateKlass.R:95:3
    2. ├─dplyr::select(., oldCode, newCode, changeOccurred)
    3. ├─dplyr::ungroup(.)
    4. ├─dplyr::filter(., dplyr::n() > 1)
    5. ├─dplyr::group_by(., oldCode)
    6. ├─dplyr::filter(., changeOccurred == "1964-01-01")
    7. ├─dplyr:::filter.data.frame(., changeOccurred == "1964-01-01")
    8. │ └─dplyr:::filter_rows(.data, dots, by)
    9. │   └─dplyr:::filter_eval(...)
   10. │     ├─base::withCallingHandlers(...)
   11. │     └─mask$eval_all_filter(dots, env_filter)
   12. │       └─dplyr (local) eval()
   13. └─base::.handleSimpleError(...)
   14.   └─dplyr (local) h(simpleError(msg, call))
   15.     └─rlang::abort(message, class = error_class, parent = parent, call = error_call)
  ── Error ('test_ApplyKlass.R:3:3'): apply_klass returns correct names for numeric codes ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::apply_klass(...) at test_ApplyKlass.R:3:3
   2.   └─klassR::get_klass(...)
   3.     └─klassR:::stop_quietly()
  ── Error ('test_ApplyKlass.R:14:3'): apply_klass returns correct names for numeric codes ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::apply_klass(...) at test_ApplyKlass.R:14:3
   2.   └─klassR::get_klass(...)
   3.     └─klassR:::stop_quietly()
  ── Error ('test_ApplyKlass.R:24:3'): apply_klass returns correct names for character codes ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::apply_klass(...) at test_ApplyKlass.R:24:3
   2.   └─klassR::get_klass(...)
   3.     └─klassR:::stop_quietly()
  ── Error ('test_ApplyKlass.R:34:3'): apply_klass returns correct language ──────
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::apply_klass(...) at test_ApplyKlass.R:34:3
   2.   └─klassR::get_klass(...)
   3.     └─klassR:::stop_quietly()
  ── Error ('test_ApplyKlass.R:55:3'): apply_klass returns correctly for character codes ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::apply_klass(sektor, 39, date = "2020-01-01") at test_ApplyKlass.R:55:3
   2.   └─klassR::get_klass(...)
   3.     └─klassR:::stop_quietly()
  ── Error ('test_ApplyKlass.R:61:3'): Check levelCheck for numerical codes ──────
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::get_klass(7, date = "2020-01-01") at test_ApplyKlass.R:61:3
   2.   └─klassR:::stop_quietly()
  ── Error ('test_ApplyKlass.R:71:3'): Check levelCheck for character codes ──────
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::get_klass(39, date = "2020-01-01") at test_ApplyKlass.R:71:3
   2.   └─klassR:::stop_quietly()
  ── Error ('test_ApplyKlass.R:81:3'): apply_klass can return a variant classification ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::apply_klass(...) at test_ApplyKlass.R:81:3
   2.   └─klassR::get_klass(...)
   3.     └─klassR:::get_variant_name(variant)
   4.       └─klassR:::stop_quietly()
  ── Error ('test_ApplyKlass.R:103:5'): apply_klass works for variant classification with Norwegian characters in the variant name ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::apply_klass(...) at test_ApplyKlass.R:103:5
   2.   └─klassR::get_klass(...)
   3.     └─klassR:::get_variant_name(variant)
   4.       └─klassR:::stop_quietly()
  ── Error ('test_ApplyKlass.R:123:3'): apply_klass works for classifications with varying number of digits ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::apply_klass(dat, classification = 270, date = "2024-01-01") at test_ApplyKlass.R:123:3
   2.   └─klassR::get_klass(...)
   3.     └─klassR:::stop_quietly()
  ── Error ('test_ApplyKlass.R:132:3'): Nace classification with missing formatting ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. ├─testthat::expect_warning(...) at test_ApplyKlass.R:132: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.     └─klassR:::stop_quietly()
  ── Error ('test_ApplyKlass.R:166:3'): Municipality classification with missing formatting ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. ├─testthat::expect_warning(...) at test_ApplyKlass.R:166: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 = 131, date = "2024-01-01")
   8.   └─klassR::get_klass(...)
   9.     └─klassR:::stop_quietly()
  ── Error ('test_ApplyKlass.R:196:3'): apply_klass works for classifications with varying digits and letters ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::apply_klass(dat, classification = 270, date = "2024-01-01") at test_ApplyKlass.R:196:3
   2.   └─klassR::get_klass(...)
   3.     └─klassR:::stop_quietly()
  ── Error ('test_GetKlass.R:4:3'): get_klass returns a classification ───────────
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::get_klass(131, date = "2015-01-01") at test_GetKlass.R:4:3
   2.   └─klassR:::stop_quietly()
  ── Error ('test_GetKlass.R:10:3'): get_klass returns a classification with Norwegian letters ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::get_klass(131, date = "2015-01-01") at test_GetKlass.R:10:3
   2.   └─klassR:::stop_quietly()
  ── Error ('test_GetKlass.R:16:3'): get_klass returns no error when no date given ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. ├─testthat::expect_type(get_klass(131), type = "list") at test_GetKlass.R:16:3
   2. │ └─testthat::quasi_label(enquo(object), arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─klassR::get_klass(131)
   5.   └─klassR:::stop_quietly()
  ── Error ('test_GetKlass.R:41:3'): get_klass returns changes when two dates given ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::get_klass(131, date = c("2022-01-01", "2023-01-01")) at test_GetKlass.R:41:3
   2.   └─klassR:::stop_quietly()
  ── Error ('test_GetKlass.R:48:3'): get_klass returns classifications with future date ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. ├─testthat::expect_message(...) at test_GetKlass.R:48: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::get_klass(2, date = "2100-01-01")
   8.   └─klassR:::stop_quietly()
  ── Error ('test_GetKlass.R:57:3'): get_klass returns correct output level ──────
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::get_klass(7, date = "2024-01-01", output_level = 1) at test_GetKlass.R:57:3
   2.   └─klassR:::stop_quietly()
  ── Error ('test_GetKlass.R:67:3'): get_klass returns english language ──────────
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::get_klass(2, date = "2024-01-01", language = "en") at test_GetKlass.R:67:3
   2.   └─klassR:::stop_quietly()
  ── Error ('test_GetKlass.R:76:3'): get_klass returns a correspondence table ────
  Error: lexical error: invalid char in json text.
                                         <?xml version='1.0' encoding='u
                       (right here) ------^
  
  Backtrace:
      ▆
   1. └─klassR::get_klass(104, correspond = 131, date = "2015-01-01") at test_GetKlass.R:76: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:85:3'): get_klass returns a correspondence table in both directions ──
  Error: lexical error: invalid char in json text.
                                         <?xml version='1.0' encoding='u
                       (right here) ------^
  
  Backtrace:
      ▆
   1. └─klassR::get_klass(104, correspond = 131, date = "2020-02-01") at test_GetKlass.R:85: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:99:3'): get_klass returns a valid variant including ones with spaces in name ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::get_klass(6, variant = 1616, date = "2021-01-02") at test_GetKlass.R:99:3
   2.   └─klassR:::get_variant_name(variant)
   3.     └─klassR:::stop_quietly()
  ── Error ('test_GetKlass.R:107:3'): get_klass returns a correspondence table ───
  Error: lexical error: invalid char in json text.
                                         <?xml version='1.0' encoding='u
                       (right here) ------^
  
  Backtrace:
      ▆
   1. └─klassR::get_klass(131, correspond = 127, date = "2024-01-02") at test_GetKlass.R:107: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:116:3'): get_klass returns a correspondent using ID ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. ├─testthat::expect_message(...) at test_GetKlass.R:116: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::get_klass(correspondID = 1441, date = "2024-01-02")
   8.   └─klassR:::stop_quietly()
  ── Error ('test_GetKlass.R:145:3'): get_klass returns notes when requested ─────
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::get_klass(277, notes = TRUE, date = "2023-01-12") at test_GetKlass.R:145:3
   2.   └─klassR:::stop_quietly()
  ── Error ('test_GetKlass.R:152:3'): get_klass returns a future classification ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. ├─testthat::expect_message(classdata <- get_klass(104, date = "2050-01-01")) at test_GetKlass.R:152: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::get_klass(104, date = "2050-01-01")
   8.   └─klassR:::stop_quietly()
  ── Error ('test_GetKlass.R:158:3'): get_klass returns a correspondence table using ID ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. ├─testthat::expect_message(...) at test_GetKlass.R:158: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::get_klass(correspondID = 1111, date = "2023-01-12")
   8.   └─klassR:::stop_quietly()
  ── Error ('test_GetKlass.R:163:3'): get_klass returns valid dates for a date range ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::get_klass(131, date = c("2020-01-01", "2024-01-02")) at test_GetKlass.R:163:3
   2.   └─klassR:::stop_quietly()
  ── Error ('test_ListKlass.R:6:3'): ListKlass returns a warning but still runs ──
  Error in `data.frame(klass_name = dt$name, klass_nr = nums, klass_family = i, 
      klass_type = dt$classificationType)`: arguments imply differing number of rows: 0, 1
  Backtrace:
      ▆
   1. ├─testthat::expect_warning(klass_table <- ListKlass()) at test_ListKlass.R:6: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:::ListKlass()
   8.   └─klassR::list_klass(codelists = codelists, language = language)
   9.     └─base::data.frame(...)
  ── Error ('test_ListKlass.R:14:3'): list_klass returns a list ──────────────────
  Error in `data.frame(klass_name = dt$name, klass_nr = nums, klass_family = i, 
      klass_type = dt$classificationType)`: arguments imply differing number of rows: 0, 1
  Backtrace:
      ▆
   1. └─klassR::list_klass() at test_ListKlass.R:14:3
   2.   └─base::data.frame(...)
  ── Error ('test_ListKlass.R:24:3'): search_klass returns searches ──────────────
  Error in `expect_in("Standard for kommuneinndeling", komm_search$klass_name)`: `object` and `expected` must both be vectors
  Backtrace:
      ▆
   1. └─testthat::expect_in("Standard for kommuneinndeling", komm_search$klass_name) at test_ListKlass.R:24:3
   2.   └─rlang::abort("`object` and `expected` must both be vectors")
  
  [ FAIL 35 | WARN 6 | SKIP 0 | PASS 28 ]
  Error: Test failures
  Execution halted