tests/testthat/test-align-subelement-deep.R

testthat::test_that("align accepts deep subelement paths and reports missing ones", {
    # No package load needed; tests run in package context during R CMD check

    nested <- list(a = list(b = list("x")), c = 1)

    expect_error(alignHorizontal(nested, subelement = c("no", "pe")), "The subelement 'no -> pe' was not found", fixed = TRUE)
    expect_error(alignVertical(nested, subelement = list(c("no", "pe"), c("a", "b"))), "The subelement 'no -> pe' was not found", fixed = TRUE)
})

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.