option to add_indent spacing to any column
diff --git a/tests/testthat/test-indent-latex.R b/tests/testthat/test-indent-latex.R
index 84d9fec..241ea82 100644
--- a/tests/testthat/test-indent-latex.R
+++ b/tests/testthat/test-indent-latex.R
@@ -17,4 +17,19 @@
expect_equal(observed, expected)
})
+test_that("add_indent can add to an interior column.", {
+ observed <- kable(mtcars[1:4, 1:3], "latex") %>%
+ add_indent(1:3, target_cols = 2) %>%
+ as.character()
+ expected <- "\n\\begin{tabular}{l|r|r|r}\n\\hline\n & mpg & cyl & disp\\\\\n\\hline\nMazda RX4 & \\hspace{1em}21.0 & 6 & 160\\\\\n\\hline\nMazda RX4 Wag & \\hspace{1em}21.0 & 6 & 160\\\\\n\\hline\nDatsun 710 & \\hspace{1em}22.8 & 4 & 108\\\\\n\\hline\nHornet 4 Drive & 21.4 & 6 & 258\\\\\n\\hline\n\\end{tabular}"
+ expect_equal(observed, expected)
+})
+test_that("add_indent can add to an interior column multiple times.", {
+ observed <- kable(mtcars[1:4, 1:3], "latex") %>%
+ add_indent(1:3, target_cols = 2) %>%
+ add_indent(1, target_cols = 2) %>%
+ as.character()
+ expected <- "\n\\begin{tabular}{l|r|r|r}\n\\hline\n & mpg & cyl & disp\\\\\n\\hline\nMazda RX4 & \\hspace{1em}\\hspace{1em}21.0 & 6 & 160\\\\\n\\hline\nMazda RX4 Wag & \\hspace{1em}21.0 & 6 & 160\\\\\n\\hline\nDatsun 710 & \\hspace{1em}22.8 & 4 & 108\\\\\n\\hline\nHornet 4 Drive & 21.4 & 6 & 258\\\\\n\\hline\n\\end{tabular}"
+ expect_equal(observed, expected)
+})