diff --git a/Makefile b/Makefile index cb9ead29..81e50dc1 100644 --- a/Makefile +++ b/Makefile @@ -6,10 +6,13 @@ help: ## Display this help screen @echo -e "\033[1mAvailable commands:\033[0m\n" @grep -E '^[a-z.A-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}' | sort -check: ## check package +check: ## check Rscript -e "devtools::document();devtools::check()" -install: ## install package +test: ## test + Rscript -e "devtools::install();library(tinytable);tinytest::run_test_dir()" + +install: ## install Rscript -e "devtools::document();devtools::install()" website: ## render vignettes and website diff --git a/R/utils.R b/R/utils.R index b472b6ea..7fd259ca 100644 --- a/R/utils.R +++ b/R/utils.R @@ -34,6 +34,9 @@ meta <- function(x, get, set) { # some rows may be added, which changes how the style is applied eval_style <- function(x) { out <- x + + ls <- meta(x)$lazy_style + for (lazy_style in meta(x)$lazy_style) { lazy_style[["x"]] <- out out <- eval(lazy_style) diff --git a/inst/tinytest/test-markdown.R b/inst/tinytest/test-markdown.R index 51a985c1..6f16cf76 100644 --- a/inst/tinytest/test-markdown.R +++ b/inst/tinytest/test-markdown.R @@ -1,6 +1,10 @@ source("helpers.R") using("tinysnapshot") +# markdown without labels k = iris[1:10,] colnames(k) <- NULL -expect_snapshot_print(tt(k), "markdown-nocolnames") +expect_snapshot_print( + tt(k, output = "markdown"), + label = "markdown-nocolnames") +