From 197da86b15fb38895d9e3e1e252999e25370f286 Mon Sep 17 00:00:00 2001 From: Chris Grandin Date: Sat, 6 Jan 2024 02:12:58 -0800 Subject: [PATCH] Fix bug and test will not fail --- R/check-yaml.R | 2 +- tests/testthat/test-get-set-render-type.R | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/R/check-yaml.R b/R/check-yaml.R index 6bc5dd79..dd6eb1b1 100644 --- a/R/check-yaml.R +++ b/R/check-yaml.R @@ -57,7 +57,7 @@ check_yaml <- function(type = c("resdoc", "resdoc_pdf", "resdoc_word", )) x_index <- names(yaml_front_matter("index.Rmd")) .diff <- setdiff(x_skeleton, x_index) - .diff <- .diff[-tag_exceptions] + .diff <- .diff[!.diff %in% tag_exceptions] if (length(.diff) > 0L) { bail("Your ", fn_color("index.Rmd"), " file is missing the YAML ", "tag(s):\n\n", tag_color(paste(.diff, collapse = "\n"))) diff --git a/tests/testthat/test-get-set-render-type.R b/tests/testthat/test-get-set-render-type.R index 75aa07a4..e00e6db6 100644 --- a/tests/testthat/test-get-set-render-type.R +++ b/tests/testthat/test-get-set-render-type.R @@ -18,11 +18,11 @@ test_that("get_render_type() and set_render_type() throw errors", { writeLines(rmd, "index.Rmd") rmd <- readLines("index.Rmd") ind <- grep("csasdown::resdoc_pdf:", rmd) - expect_identical(ind, 45L) + expect_identical(ind, 51L) csasdown:::set_render_type("index.Rmd", "asis") rmd <- readLines("index.Rmd") ind <- grep("csasdown::resdoc_pdf:", rmd) - expect_identical(ind, 45L) + expect_identical(ind, 51L) # --------------------------------------------------------------------------- rmd[ind] <- ""