Running ‘testthat.R’ [47s/54s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(ggtikz)
  > 
  > test_check("ggtikz")
  [ FAIL 15 | WARN 0 | SKIP 0 | PASS 271 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-coord_utils.R:30:5'): coordinates are replaced correctly ───────
  Error in `stringr::str_replace_all(tikz_code, pattern_coord, replace_func)`: `replacement` function must return a vector the same length as the input (2), not length 1.
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(...) at test-coord_utils.R:30:5
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─ggtikz:::replace_coords("\\draw (0,0) (1,1);", f)
   5.   └─stringr::str_replace_all(tikz_code, pattern_coord, replace_func)
   6.     └─stringr:::str_transform_all(string, pattern, replacement)
   7.       └─cli::cli_abort(...)
   8.         └─rlang::abort(...)
  ── Error ('test-ggtikz.R:6:5'): the ggtikz helper works ────────────────────────
  Error in `stringr::str_replace_all(tikz_code, pattern_coord, replace_func)`: `replacement` function must return a vector the same length as the input (2), not length 1.
  Backtrace:
       ▆
    1. └─ggtikz:::tempTikz(test_ggtikz) at test-ggtikz.R:6:5
    2.   └─ggtikz (local) fun() at tests/testthat/helpers.R:5:5
    3.     └─ggtikz::ggtikz(p, "\\draw (0,0) -- (1,1);", xy = "plot") at test-ggtikz.R:3:5
    4.       └─ggtikz:::`+.ggtikzCanvas`(canvas, annotation)
    5.         ├─ggtikz:::add_annotation(e1, e2)
    6.         └─ggtikz:::add_annotation.ggtikzCanvas(e1, e2)
    7.           └─ggtikz:::ggtikzTransform(self, ggtikzAnnotation)
    8.             └─ggtikz:::transform_tikz(...)
    9.               └─ggtikz:::replace_coords(tikz_code, replace_func)
   10.                 └─stringr::str_replace_all(tikz_code, pattern_coord, replace_func)
   11.                   └─stringr:::str_transform_all(string, pattern, replacement)
   12.                     └─cli::cli_abort(...)
   13.                       └─rlang::abort(...)
  ── Error ('test-ggtikz.R:17:5'): the ggtikz helper throws an error when no plot is drawn ──
  Error in `stringr::str_replace_all(tikz_code, pattern_coord, replace_func)`: `replacement` function must return a vector the same length as the input (2), not length 1.
  Backtrace:
       ▆
    1. ├─testthat::expect_error(tempTikz(test_ggtikz_nodraw), "Could not activate the plot panel.") at test-ggtikz.R:17:5
    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. └─ggtikz:::tempTikz(test_ggtikz_nodraw)
    8.   └─ggtikz (local) fun() at tests/testthat/helpers.R:5:5
    9.     └─ggtikz::ggtikz(...) at test-ggtikz.R:13:5
   10.       └─ggtikz:::`+.ggtikzCanvas`(canvas, annotation)
   11.         ├─ggtikz:::add_annotation(e1, e2)
   12.         └─ggtikz:::add_annotation.ggtikzCanvas(e1, e2)
   13.           └─ggtikz:::ggtikzTransform(self, ggtikzAnnotation)
   14.             └─ggtikz:::transform_tikz(...)
   15.               └─ggtikz:::replace_coords(tikz_code, replace_func)
   16.                 └─stringr::str_replace_all(tikz_code, pattern_coord, replace_func)
   17.                   └─stringr:::str_transform_all(string, pattern, replacement)
   18.                     └─cli::cli_abort(...)
   19.                       └─rlang::abort(...)
  ── Error ('test-ggtikzCanvas.R:207:5'): drawing annotations does not fail ──────
  Error in `stringr::str_replace_all(tikz_code, pattern_coord, replace_func)`: `replacement` function must return a vector the same length as the input (2), not length 1.
  Backtrace:
       ▆
    1. └─ggtikz:::tempTikz(testfun_ggtikz) at test-ggtikzCanvas.R:207:5
    2.   └─ggtikz (local) fun() at tests/testthat/helpers.R:5:5
    3.     ├─base::print(canvas + annot) at test-ggtikzCanvas.R:204:5
    4.     └─ggtikz:::`+.ggtikzCanvas`(canvas, annot)
    5.       ├─ggtikz:::add_annotation(e1, e2)
    6.       └─ggtikz:::add_annotation.ggtikzCanvas(e1, e2)
    7.         └─ggtikz:::ggtikzTransform(self, ggtikzAnnotation)
    8.           └─ggtikz:::transform_tikz(...)
    9.             └─ggtikz:::replace_coords(tikz_code, replace_func)
   10.               └─stringr::str_replace_all(tikz_code, pattern_coord, replace_func)
   11.                 └─stringr:::str_transform_all(string, pattern, replacement)
   12.                   └─cli::cli_abort(...)
   13.                     └─rlang::abort(...)
  ── Error ('test-ggtikzTransform.R:42:5'): multiple coordinates can be transformed ──
  Error in `stringr::str_replace_all(tikz_code, pattern_coord, replace_func)`: `replacement` function must return a vector the same length as the input (3), not length 1.
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(...) at test-ggtikzTransform.R:42:5
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─ggtikz:::transform_tikz(coords, plus1, plus1)
   5.   └─ggtikz:::replace_coords(tikz_code, replace_func)
   6.     └─stringr::str_replace_all(tikz_code, pattern_coord, replace_func)
   7.       └─stringr:::str_transform_all(string, pattern, replacement)
   8.         └─cli::cli_abort(...)
   9.           └─rlang::abort(...)
  ── Error ('test-ggtikzTransform.R:55:5'): multi-line tikz code can be transformed ──
  Error in `stringr::str_replace_all(tikz_code, pattern_coord, replace_func)`: `replacement` function must return a vector the same length as the input (3), not length 1.
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(...) at test-ggtikzTransform.R:55:5
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─ggtikz:::transform_tikz(tikz_code, plus1, plus2)
   5.   └─ggtikz:::replace_coords(tikz_code, replace_func)
   6.     └─stringr::str_replace_all(tikz_code, pattern_coord, replace_func)
   7.       └─stringr:::str_transform_all(string, pattern, replacement)
   8.         └─cli::cli_abort(...)
   9.           └─rlang::abort(...)
  ── Error ('test-ggtikzTransform.R:62:5'): coordinates intermixed with radii can be transformed ──
  Error in `stringr::str_replace_all(tikz_code, pattern_coord, replace_func)`: `replacement` function must return a vector the same length as the input (5), not length 1.
  Backtrace:
      ▆
   1. └─ggtikz:::transform_tikz(input, plus1, plus1) at test-ggtikzTransform.R:62:5
   2.   └─ggtikz:::replace_coords(tikz_code, replace_func)
   3.     └─stringr::str_replace_all(tikz_code, pattern_coord, replace_func)
   4.       └─stringr:::str_transform_all(string, pattern, replacement)
   5.         └─cli::cli_abort(...)
   6.           └─rlang::abort(...)
  ── Error ('test-ggtikzTransform.R:74:5'): tikz_code in annotations is transformed for data reference frames ──
  Error in `stringr::str_replace_all(tikz_code, pattern_coord, replace_func)`: `replacement` function must return a vector the same length as the input (2), not length 1.
  Backtrace:
      ▆
   1. └─ggtikz (local) expect_transformed_equal(canvas, annotation, "\\draw (10,1) -- (100,2);") at test-ggtikzTransform.R:74:5
   2.   └─ggtikz:::ggtikzTransform(canvas, annotation) at test-ggtikzTransform.R:68:5
   3.     └─ggtikz:::transform_tikz(...)
   4.       └─ggtikz:::replace_coords(tikz_code, replace_func)
   5.         └─stringr::str_replace_all(tikz_code, pattern_coord, replace_func)
   6.           └─stringr:::str_transform_all(string, pattern, replacement)
   7.             └─cli::cli_abort(...)
   8.               └─rlang::abort(...)
  ── Error ('test-ggtikzTransform.R:80:5'): tikz_code in annotations is transformed correctly for discrete scales ──
  Error in `stringr::str_replace_all(tikz_code, pattern_coord, replace_func)`: `replacement` function must return a vector the same length as the input (2), not length 1.
  Backtrace:
      ▆
   1. └─ggtikz (local) expect_transformed_equal(canvas, annotation, "\\draw (1,1) -- (2,2);") at test-ggtikzTransform.R:80:5
   2.   └─ggtikz:::ggtikzTransform(canvas, annotation) at test-ggtikzTransform.R:68:5
   3.     └─ggtikz:::transform_tikz(...)
   4.       └─ggtikz:::replace_coords(tikz_code, replace_func)
   5.         └─stringr::str_replace_all(tikz_code, pattern_coord, replace_func)
   6.           └─stringr:::str_transform_all(string, pattern, replacement)
   7.             └─cli::cli_abort(...)
   8.               └─rlang::abort(...)
  ── Error ('test-ggtikzTransform.R:87:5'): tikz_code in annotations is not transformed for panel reference frames ──
  Error in `stringr::str_replace_all(tikz_code, pattern_coord, replace_func)`: `replacement` function must return a vector the same length as the input (2), not length 1.
  Backtrace:
      ▆
   1. └─ggtikz (local) expect_transformed_equal(canvas, annotation, "\\draw (0.5,0.5) -- (0.5,0.5);") at test-ggtikzTransform.R:87:5
   2.   └─ggtikz:::ggtikzTransform(canvas, annotation) at test-ggtikzTransform.R:68:5
   3.     └─ggtikz:::transform_tikz(...)
   4.       └─ggtikz:::replace_coords(tikz_code, replace_func)
   5.         └─stringr::str_replace_all(tikz_code, pattern_coord, replace_func)
   6.           └─stringr:::str_transform_all(string, pattern, replacement)
   7.             └─cli::cli_abort(...)
   8.               └─rlang::abort(...)
  ── Error ('test-ggtikzTransform.R:94:5'): tikz_code in annotations is not transformed for plot reference frames ──
  Error in `stringr::str_replace_all(tikz_code, pattern_coord, replace_func)`: `replacement` function must return a vector the same length as the input (2), not length 1.
  Backtrace:
      ▆
   1. └─ggtikz (local) expect_transformed_equal(canvas, annotation, "\\draw (0.5,0.5) -- (0.5,0.5);") at test-ggtikzTransform.R:94:5
   2.   └─ggtikz:::ggtikzTransform(canvas, annotation) at test-ggtikzTransform.R:68:5
   3.     └─ggtikz:::transform_tikz(...)
   4.       └─ggtikz:::replace_coords(tikz_code, replace_func)
   5.         └─stringr::str_replace_all(tikz_code, pattern_coord, replace_func)
   6.           └─stringr:::str_transform_all(string, pattern, replacement)
   7.             └─cli::cli_abort(...)
   8.               └─rlang::abort(...)
  ── Error ('test-ggtikzTransform.R:101:5'): tikz_code in annotations is transformed correctly for mixed references ──
  Error in `stringr::str_replace_all(tikz_code, pattern_coord, replace_func)`: `replacement` function must return a vector the same length as the input (2), not length 1.
  Backtrace:
      ▆
   1. └─ggtikz (local) expect_transformed_equal(canvas, annotation, "\\draw (0.5,1) -- (0.5,2);") at test-ggtikzTransform.R:101:5
   2.   └─ggtikz:::ggtikzTransform(canvas, annotation) at test-ggtikzTransform.R:68:5
   3.     └─ggtikz:::transform_tikz(...)
   4.       └─ggtikz:::replace_coords(tikz_code, replace_func)
   5.         └─stringr::str_replace_all(tikz_code, pattern_coord, replace_func)
   6.           └─stringr:::str_transform_all(string, pattern, replacement)
   7.             └─cli::cli_abort(...)
   8.               └─rlang::abort(...)
  ── Error ('test-ggtikzTransform.R:109:5'): tikz_code in annotations is transformed only once ──
  Error in `stringr::str_replace_all(tikz_code, pattern_coord, replace_func)`: `replacement` function must return a vector the same length as the input (2), not length 1.
  Backtrace:
       ▆
    1. └─ggtikz:::`+.ggtikzCanvas`(canvas, annotation) at test-ggtikzTransform.R:109:5
    2.   ├─ggtikz:::add_annotation(e1, e2)
    3.   └─ggtikz:::add_annotation.ggtikzCanvas(e1, e2)
    4.     └─ggtikz:::ggtikzTransform(self, ggtikzAnnotation)
    5.       └─ggtikz:::transform_tikz(...)
    6.         └─ggtikz:::replace_coords(tikz_code, replace_func)
    7.           └─stringr::str_replace_all(tikz_code, pattern_coord, replace_func)
    8.             └─stringr:::str_transform_all(string, pattern, replacement)
    9.               └─cli::cli_abort(...)
   10.                 └─rlang::abort(...)
  ── Error ('test-ggtikzUninfinite.R:36:5'): removal of Inf from annotations works in a linear scale ──
  Error in `stringr::str_replace_all(tikz_code, pattern_coord, replace_func)`: `replacement` function must return a vector the same length as the input (2), not length 1.
  Backtrace:
      ▆
   1. └─ggtikz (local) expect_uninfinite_equal(c1, annot_plot, "\\draw (0,1) -- (1,1);") at test-ggtikzUninfinite.R:36:5
   2.   └─ggtikz:::ggtikzUninfinite(canvas, annotation) at test-ggtikzUninfinite.R:30:5
   3.     └─ggtikz:::uninfinite_tikz(...)
   4.       └─ggtikz:::replace_coords(tikz_code, replace_func)
   5.         └─stringr::str_replace_all(tikz_code, pattern_coord, replace_func)
   6.           └─stringr:::str_transform_all(string, pattern, replacement)
   7.             └─cli::cli_abort(...)
   8.               └─rlang::abort(...)
  ── Error ('test-ggtikzUninfinite.R:49:5'): removal of Inf from annotations works in a log scale ──
  Error in `stringr::str_replace_all(tikz_code, pattern_coord, replace_func)`: `replacement` function must return a vector the same length as the input (2), not length 1.
  Backtrace:
      ▆
   1. └─ggtikz (local) expect_uninfinite_equal(c1, annot_plot, "\\draw (0,1) -- (1,1);") at test-ggtikzUninfinite.R:49:5
   2.   └─ggtikz:::ggtikzUninfinite(canvas, annotation) at test-ggtikzUninfinite.R:30:5
   3.     └─ggtikz:::uninfinite_tikz(...)
   4.       └─ggtikz:::replace_coords(tikz_code, replace_func)
   5.         └─stringr::str_replace_all(tikz_code, pattern_coord, replace_func)
   6.           └─stringr:::str_transform_all(string, pattern, replacement)
   7.             └─cli::cli_abort(...)
   8.               └─rlang::abort(...)
  
  [ FAIL 15 | WARN 0 | SKIP 0 | PASS 271 ]
  Error: Test failures
  Execution halted