tests/testthat/test-label-compose.R

test_that("compose_labels can chain together functions", {

  labeller <- compose_label(`-`, label_number(suffix = " foo"), toupper)
  expect_equal(
    labeller(c(0.1, 1.0, 10.0)),
    c("-0.1 FOO", "-1.0 FOO", "-10.0 FOO"),
    ignore_attr = TRUE
  )

})
r-lib/scales documentation built on Nov. 2, 2024, 9:31 a.m.