tests/testthat/test-grid-utils.R

test_that("width_cm and height_cm work with unit arithmetic", {
  x <- 2 * unit(1, "cm")

  expect_equal(width_cm(x), 2)
  expect_equal(height_cm(x), 2)
})
hadley/ggplot2 documentation built on April 24, 2024, 12:16 a.m.