Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ inst/doc
revdep/
!revdep/*.md
!revdep/problems.md
tests/testthat/*/*-in_tree
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check that this is correct ignore directive.

touchstone/*
!touchstone/config.json
!touchstone/script.R
16 changes: 0 additions & 16 deletions R/set-assert-args.R
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
#' Set the write_tree argument
#'
#' Sets the argument `write_tree` in [test_collection()] to be `TRUE` for R
#' versions higher or equal to 3.2, and `FALSE` otherwise since the second-level
#' dependency `DiagrammeR` from `data.tree` is not available for R < 3.2.
#' @param write_tree Whether or not to write tree.
#' @keywords internal
set_arg_write_tree <- function(write_tree) {
if (is.na(write_tree)) {
write_tree <- is_installed("data.tree")
} else if (write_tree) {
check_installed("data.tree")
}
write_tree
}

#' Assert the transformers
#'
#' Actually only assert name and version of style guide in order to make sure
Expand Down
10 changes: 4 additions & 6 deletions R/testing.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#' @keywords internal
test_collection <- function(test, sub_test = NULL,
dry = "off",
write_tree = NA,
write_tree = FALSE,
transformer,
...) {
path <- rprojroot::find_testthat_root_file(test)
Expand Down Expand Up @@ -93,19 +93,17 @@ construct_tree <- function(in_paths, suffix = "_tree") {
#' @param out_name The label of the out_item, defaults to `out_item`.
#' @param transformer A function to apply to the content of `in_item`.
#' @param write_tree Whether or not the tree structure of the test should be
#' computed and written to a file. Note that this needs R >= 3.2
#' (see [set_arg_write_tree()]). If the argument is set to `NA`, the function
#' determines whether R >= 3.2 is in use and if so, trees will be written.
#' computed and written to a files.
#' @param ... Parameters passed to transformer function.
#' @param out_tree Name of tree file if written out.
#' @inheritParams transform_utf8
#' @keywords internal
transform_and_check <- function(in_item, out_item,
in_name = in_item, out_name = out_item,
transformer, dry,
write_tree = NA,
write_tree = FALSE,
out_tree = "_tree", ...) {
write_tree <- set_arg_write_tree(write_tree)
if (write_tree) check_installed("data.tree")
read_in <- read_utf8_bare(in_item)
if (write_tree) {
create_tree(read_in) %>%
Expand Down
17 changes: 0 additions & 17 deletions man/set_arg_write_tree.Rd

This file was deleted.

6 changes: 2 additions & 4 deletions man/test_collection.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions man/transform_and_check.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

73 changes: 0 additions & 73 deletions tests/testthat/alignment/cols-with-one-row-in_tree

This file was deleted.

Loading