tests/testthat/test-print-Gmisc_list_of_boxes.R

testthat::test_that("print handles nested plain lists of boxes", {
    library(grid)
    a <- boxGrob("A", x = .2, y = .8)
    b <- boxGrob("B", x = .4, y = .6)

    # nested as plain lists
    nested <- list(grp = list(sub = list(a, b))) |>
        prExtendClass("Gmisc_list_of_boxes")

    # Should not error when printing
    testthat::expect_silent(print(nested))
})

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.