Skip to content

Commit e3c56eb

Browse files
committed
add test
1 parent c1781e4 commit e3c56eb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/testthat/test-scale-binned.R

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ test_that("binned limits should not compute out-of-bounds breaks", {
4444
))
4545
})
4646

47+
test_that("binned scales can use limits and transformations simultaneously (#6144)", {
48+
s <- scale_x_binned(
49+
limits = function(x) x + 1,
50+
trans = transform_log10()
51+
)
52+
s$train(c(0, 1)) # c(1, 10) in untransformed space
53+
out <- s$get_limits()
54+
expect_equal(s$get_limits(), log10(c(2, 11)))
55+
})
56+
4757
test_that("binned scales can use NAs in limits", {
4858
scale <- scale_x_binned(limits = c(NA, 10))
4959
scale$train(c(-20, 20))

0 commit comments

Comments
 (0)