| 1 |
test_that("can format new_pillar_title()", { |
| 2 |
expect_equal( |
| 3 |
format(new_pillar_title(tick_if_needed(c("a", "b c")))), |
| 4 |
format_full_pillar_title(tick_if_needed(c("a", "b c"))) |
| 5 |
) |
| 6 |
expect_equal( |
| 7 |
format(new_pillar_title(names(mtcars))), |
| 8 |
format_full_pillar_title(names(mtcars)) |
| 9 |
) |
| 10 |
}) |
| 11 |
|
| 12 |
test_that("titles are left-adjusted", { |
| 13 |
expect_equal( |
| 14 |
get_extent(format(new_pillar_title(c("ab", "c")))), |
| 15 |
c(2, 2) |
| 16 |
) |
| 17 |
expect_equal( |
| 18 |
format(new_pillar_title(c("ab", "c"))), |
| 19 |
style_title(c("ab", "c ")) |
| 20 |
) |
| 21 |
}) |