Skip to content

Commit

Permalink
Adapt tests
Browse files Browse the repository at this point in the history
  • Loading branch information
teunbrand committed Sep 18, 2023
1 parent db16982 commit 6746c0b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/testthat/test-guides.R
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,15 @@ test_that("guide merging for guide_legend() works as expected", {
scales <- scales_list()
scales$add(scale1)
scales$add(scale2)
scales <- scales$scales

aesthetics <- lapply(scales, `[[`, "aesthetics")
scales <- rep.int(scales, lengths(aesthetics))
aesthetics <- unlist(aesthetics, FALSE, FALSE)

guides <- guides_list(NULL)
guides <- guides$setup(scales$scales)
guides$train(scales$scales, "vertical", labs())
guides <- guides$setup(scales, aesthetics)
guides$train(scales, "vertical", labs())
guides$merge()
guides$params
}
Expand Down Expand Up @@ -279,7 +284,7 @@ test_that("legend reverse argument reverses the key", {
scale$train(LETTERS[1:4])

guides <- guides_list(NULL)
guides <- guides$setup(list(scale))
guides <- guides$setup(list(scale), "colour")

guides$params[[1]]$reverse <- FALSE
guides$train(list(scale), "horizontal", labels = labs())
Expand Down

0 comments on commit 6746c0b

Please sign in to comment.