tests/testthat/test-ipea_label_size.R

test_that("ipea_label_size() converts pt to the mm size ggplot2 expects", {
  expect_equal(ipea_label_size(6), 6 / 2.845276)
  expect_equal(ipea_label_size(7), 7 / 2.845276)
})

test_that("ipea_label_size() defaults to 6pt", {
  expect_equal(ipea_label_size(), ipea_label_size(6))
})

test_that("ipea_label_size() rejects negative sizes", {
  expect_error(ipea_label_size(-1))
})

test_that("ipea_label_size() accepts zero", {
  expect_equal(ipea_label_size(0), 0)
})

Try the ipeaplot package in your browser

Any scripts or data that you put into this service are public.

ipeaplot documentation built on Aug. 31, 2026, 5:08 p.m.