Skip to content

Commit f9d4ab4

Browse files
merge with main
2 parents 18bae50 + 1088ede commit f9d4ab4

File tree

227 files changed

+9
-20981
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

227 files changed

+9
-20981
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ inst/doc
1414
revdep/
1515
!revdep/*.md
1616
!revdep/problems.md
17+
tests/testthat/*/*-in_tree
1718
touchstone/*
1819
!touchstone/config.json
1920
!touchstone/script.R

Diff for: R/set-assert-args.R

-16
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
#' Set the write_tree argument
2-
#'
3-
#' Sets the argument `write_tree` in [test_collection()] to be `TRUE` for R
4-
#' versions higher or equal to 3.2, and `FALSE` otherwise since the second-level
5-
#' dependency `DiagrammeR` from `data.tree` is not available for R < 3.2.
6-
#' @param write_tree Whether or not to write tree.
7-
#' @keywords internal
8-
set_arg_write_tree <- function(write_tree) {
9-
if (is.na(write_tree)) {
10-
write_tree <- is_installed("data.tree")
11-
} else if (write_tree) {
12-
check_installed("data.tree")
13-
}
14-
write_tree
15-
}
16-
171
#' Assert the transformers
182
#'
193
#' Actually only assert name and version of style guide in order to make sure

Diff for: R/testing.R

+4-6
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#' @keywords internal
2020
test_collection <- function(test, sub_test = NULL,
2121
dry = "off",
22-
write_tree = NA,
22+
write_tree = FALSE,
2323
transformer,
2424
...) {
2525
path <- rprojroot::find_testthat_root_file(test)
@@ -93,19 +93,17 @@ construct_tree <- function(in_paths, suffix = "_tree") {
9393
#' @param out_name The label of the out_item, defaults to `out_item`.
9494
#' @param transformer A function to apply to the content of `in_item`.
9595
#' @param write_tree Whether or not the tree structure of the test should be
96-
#' computed and written to a file. Note that this needs R >= 3.2
97-
#' (see [set_arg_write_tree()]). If the argument is set to `NA`, the function
98-
#' determines whether R >= 3.2 is in use and if so, trees will be written.
96+
#' computed and written to a files.
9997
#' @param ... Parameters passed to transformer function.
10098
#' @param out_tree Name of tree file if written out.
10199
#' @inheritParams transform_utf8
102100
#' @keywords internal
103101
transform_and_check <- function(in_item, out_item,
104102
in_name = in_item, out_name = out_item,
105103
transformer, dry,
106-
write_tree = NA,
104+
write_tree = FALSE,
107105
out_tree = "_tree", ...) {
108-
write_tree <- set_arg_write_tree(write_tree)
106+
if (write_tree) check_installed("data.tree")
109107
read_in <- read_utf8_bare(in_item)
110108
if (write_tree) {
111109
create_tree(read_in) %>%

Diff for: man/set_arg_write_tree.Rd

-17
This file was deleted.

Diff for: man/test_collection.Rd

+2-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: man/transform_and_check.Rd

+2-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: tests/testthat/alignment/cols-with-one-row-in_tree

-73
This file was deleted.

0 commit comments

Comments
 (0)