Skip to content

Commit

Permalink
edit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yjunechoe committed Oct 15, 2024
1 parent 605d6f5 commit 71ba8f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 3 additions & 1 deletion tests/testthat/test-ggtrace-fns.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ test_that("basic tracing tests for for custom functions", {
expect_message(ggtrace(test_fn, 2:4, verbose = FALSE), "now being traced")
invisible(test_fn())
expect_true(isFALSE(is_traced(test_fn)))
expect_equal(unlist(last_ggtrace()), 1:3)
expect_named(last_ggtrace())
expect_equal(unname(last_ggtrace()), list(1,2,3))

expect_message(ggtrace(test_fn, 3, quote(a <- 10), verbose = FALSE), "now being traced")
result_modified <- invisible(test_fn())
Expand Down Expand Up @@ -129,3 +130,4 @@ test_that("ggbody supports functions", {
})

global_ggtrace_state(FALSE)

2 changes: 0 additions & 2 deletions tests/testthat/test-ggtrace.R
Original file line number Diff line number Diff line change
Expand Up @@ -372,14 +372,12 @@ test_that("tracing every step of ggplot build works", {
x = ggplot(),
method = ggplot2:::ggplot_build.ggplot,
trace_steps = seq_along(body(ggplot2:::ggplot_build.ggplot)),
use_names = FALSE,
out = "tracedump"
)),
names(with_ggtrace(
x = ggplot(),
method = ggplot2:::ggplot_build.ggplot,
trace_steps = "all",
use_names = FALSE,
out = "tracedump"
))
)
Expand Down

0 comments on commit 71ba8f9

Please sign in to comment.