tests/testthat/test-align-reference-zero.R

testthat::test_that("alignVertical handles numeric reference 0 as coordinate, not list index", {
    a <- 5
    res <- testthat::expect_error(alignVertical(
        reference = 0, position = "bottom",
        bquote(alpha == theta[1] * .(a) + ldots) |> boxGrob(),
        paste("argument", sQuote("x"), "\nmust be non-zero") |> boxGrob()
    ), NA)
    testthat::expect_true(inherits(res, "Gmisc_list_of_boxes"))
})

Try the Gmisc package in your browser

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

Gmisc documentation built on March 6, 2026, 9:09 a.m.