Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Housekeeping #43

Merged
merged 3 commits into from
Jul 9, 2023
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
2 changes: 2 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v3

Expand Down
2 changes: 1 addition & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ footer:
left: [developed_by, built_with, legal]
right: [blank]
components:
legal: "<br>Copyright &copy; 2022 Merck & Co., Inc., Rahway, NJ, USA and its affiliates. All rights reserved."
legal: "<br>Copyright &copy; 2023 Merck & Co., Inc., Rahway, NJ, USA and its affiliates. All rights reserved."
blank: "<span></span>"

code:
Expand Down
95 changes: 36 additions & 59 deletions tests/testthat/test-independent-test_templates.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ file_spec_func_valid <- function() {
)

return(
fs_source$path == path
& fs_source$pattern == pattern
& fs_source$format == format
& fs_source$recursive == recursive
& fs_source$ignore_case == ignore_case
& fs_source$all_files == all_files
& class(fs_source) == "file_spec"
fs_source$path == path &
fs_source$pattern == pattern &
fs_source$format == format &
fs_source$recursive == recursive &
fs_source$ignore_case == ignore_case &
fs_source$all_files == all_files &
class(fs_source) == "file_spec"
)
}

Expand All @@ -35,8 +35,7 @@ fs_unlist <- function(fs) {
if (class(x) == "file_spec") {
ls_cnt <- ls_cnt + 1
ls[[ls_cnt]] <- x
}
else if (class(x) == "list") {
} else if (class(x) == "list") {
ls_tmp <- fs_unlist(x)
for (j in seq_len(length(ls_tmp))) {
ls_cnt <- ls_cnt + 1
Expand All @@ -50,13 +49,13 @@ fs_unlist <- function(fs) {

# check if a file_spec object has all of the parameters as specified
is_file_spec_type <- function(fs_source, path, pattern, format, recursive, ignore_case, all_files) {
return(fs_source$path == path
& fs_source$pattern == pattern
& fs_source$format == format
& fs_source$recursive == recursive
& fs_source$ignore_case == ignore_case
& fs_source$all_files == all_files
& class(fs_source) == "file_spec")
return(fs_source$path == path &
fs_source$pattern == pattern &
fs_source$format == format &
fs_source$recursive == recursive &
fs_source$ignore_case == ignore_case &
fs_source$all_files == all_files &
class(fs_source) == "file_spec")
}

testthat::test_that("file_root_core() creates the correct 'file_spec' object", {
Expand Down Expand Up @@ -110,8 +109,7 @@ testthat::test_that("file_r() creates the correct 'file_spec' objects", {
)
) {
is_spec_code <- TRUE
}
else if
} else if
(!is_spec_data & is_file_spec_type(
fs_source = fs,
path = "R/",
Expand Down Expand Up @@ -155,8 +153,7 @@ testthat::test_that("file_man() creates the correct 'file_spec' objects", {
)
) {
is_spec_rd <- TRUE
}
else if
} else if
(!is_spec_fig_binary & is_file_spec_type(
fs_source = fs,
path = "man/figures/",
Expand All @@ -168,8 +165,7 @@ testthat::test_that("file_man() creates the correct 'file_spec' objects", {
)
) {
is_spec_fig_binary <- TRUE
}
else if
} else if
(!is_spec_fig_text & is_file_spec_type(
fs_source = fs,
path = "man/figures/",
Expand Down Expand Up @@ -242,8 +238,7 @@ testthat::test_that("file_vignettes() creates the correct 'file_spec' objects",
)
) {
is_spec_text <- TRUE
}
else if
} else if
(!is_spec_binary & is_file_spec_type(
fs_source = fs,
path = "vignettes/",
Expand Down Expand Up @@ -295,8 +290,7 @@ testthat::test_that("file_default() creates the correct 'file_spec' objects", {
)
) {
is_root_core <- TRUE
}
else if (!is_spec_code & is_file_spec_type(
} else if (!is_spec_code & is_file_spec_type(
fs_source = fs,
path = "R/",
pattern = "\\.R$|\\.r$|\\.s$|\\.q$",
Expand All @@ -307,8 +301,7 @@ testthat::test_that("file_default() creates the correct 'file_spec' objects", {
)
) {
is_spec_code <- TRUE
}
else if
} else if
(!is_spec_data & is_file_spec_type(
fs_source = fs,
path = "R/",
Expand All @@ -320,8 +313,7 @@ testthat::test_that("file_default() creates the correct 'file_spec' objects", {
)
) {
is_spec_data <- TRUE
}
else if (!is_spec_rd & is_file_spec_type(
} else if (!is_spec_rd & is_file_spec_type(
fs_source = fs,
path = "man/",
pattern = "\\.Rd$|\\.rd$",
Expand All @@ -332,8 +324,7 @@ testthat::test_that("file_default() creates the correct 'file_spec' objects", {
)
) {
is_spec_rd <- TRUE
}
else if
} else if
(!is_spec_fig_binary & is_file_spec_type(
fs_source = fs,
path = "man/figures/",
Expand All @@ -345,8 +336,7 @@ testthat::test_that("file_default() creates the correct 'file_spec' objects", {
)
) {
is_spec_fig_binary <- TRUE
}
else if
} else if
(!is_spec_fig_text & is_file_spec_type(
fs_source = fs,
path = "man/figures/",
Expand All @@ -358,8 +348,7 @@ testthat::test_that("file_default() creates the correct 'file_spec' objects", {
)
) {
is_spec_fig_text <- TRUE
}
else if
} else if
(!is_src & is_file_spec_type(
fs_source = fs,
path = "src/",
Expand All @@ -371,9 +360,7 @@ testthat::test_that("file_default() creates the correct 'file_spec' objects", {
)
) {
is_src <- TRUE
}

else if (!is_spec_text & is_file_spec_type(
} else if (!is_spec_text & is_file_spec_type(
fs_source = fs,
path = "vignettes/",
pattern = "\\.R$|\\.r$|\\.s$|\\.q$|\\.Rd$|\\.rd$|\\.svg$|\\.c$|\\.h$|\\.cpp$|\\.cc$|\\.hpp$|\\.hxx$|\\.hh$|\\.f$|\\.f90$|\\.f95$|\\.f03$|\\.win$|\\.in$|\\.ucrt$|\\.ac$|\\.Rmd$|\\.md$|\\.csl$|\\.Rnw$|\\.tex$|\\.ltx$|\\.rsp$|\\.cls$|\\.sty$|\\.bib$|\\.bst$|\\.asis$|\\.el$|\\.Rproj$|\\.dcf$|\\.yml$|\\.yaml$|\\.note$|\\.csv$|\\.tsv$|\\.txt$|\\.html$|\\.htm$|\\.shtml$|\\.css$|\\.js$|\\.json$|\\.xml$|\\.scss$|\\.less$|\\.rtf$|\\.save$|\\.Rout$|\\.stan$|\\.bug$|\\.jags$|\\.py$|\\.ipynb$|\\.sh$|\\.java$|\\.bat$|\\.m4$|\\.cmake$|\\.sql$|\\.lua$|\\.rs$|\\.jl$|\\.pl$|\\.pm$|\\.brew$|\\.po$|\\.pot$|\\.geojson$|\\.kml$|\\.prj$|\\.cpg$|\\.qpj$|\\.fasta$|\\.fastq$|\\.vcf$|\\.ped$|\\.bim$|\\.fam$|\\.gff$|\\.gtf$",
Expand All @@ -384,8 +371,7 @@ testthat::test_that("file_default() creates the correct 'file_spec' objects", {
)
) {
is_spec_text <- TRUE
}
else if
} else if
(!is_spec_binary & is_file_spec_type(
fs_source = fs,
path = "vignettes/",
Expand All @@ -397,8 +383,7 @@ testthat::test_that("file_default() creates the correct 'file_spec' objects", {
)
) {
is_spec_binary <- TRUE
}
else if
} else if
(!is_data & is_file_spec_type(
fs_source = fs,
path = "data/",
Expand Down Expand Up @@ -457,8 +442,7 @@ testthat::test_that("file_ectd() creates the correct 'file_spec' objects", {
)
) {
is_root_core <- TRUE
}
else if (!is_spec_code & is_file_spec_type(
} else if (!is_spec_code & is_file_spec_type(
fs_source = fs,
path = "R/",
pattern = "\\.R$|\\.r$|\\.s$|\\.q$",
Expand All @@ -469,8 +453,7 @@ testthat::test_that("file_ectd() creates the correct 'file_spec' objects", {
)
) {
is_spec_code <- TRUE
}
else if
} else if
(!is_spec_data & is_file_spec_type(
fs_source = fs,
path = "R/",
Expand All @@ -482,8 +465,7 @@ testthat::test_that("file_ectd() creates the correct 'file_spec' objects", {
)
) {
is_spec_data <- TRUE
}
else if (!is_spec_rd & is_file_spec_type(
} else if (!is_spec_rd & is_file_spec_type(
fs_source = fs,
path = "man/",
pattern = "\\.Rd$|\\.rd$",
Expand All @@ -494,8 +476,7 @@ testthat::test_that("file_ectd() creates the correct 'file_spec' objects", {
)
) {
is_spec_rd <- TRUE
}
else if
} else if
(!is_spec_fig_binary & is_file_spec_type(
fs_source = fs,
path = "man/figures/",
Expand All @@ -507,8 +488,7 @@ testthat::test_that("file_ectd() creates the correct 'file_spec' objects", {
)
) {
is_spec_fig_binary <- TRUE
}
else if
} else if
(!is_spec_fig_text & is_file_spec_type(
fs_source = fs,
path = "man/figures/",
Expand All @@ -520,8 +500,7 @@ testthat::test_that("file_ectd() creates the correct 'file_spec' objects", {
)
) {
is_spec_fig_text <- TRUE
}
else if
} else if
(!is_src & is_file_spec_type(
fs_source = fs,
path = "src/",
Expand All @@ -533,8 +512,7 @@ testthat::test_that("file_ectd() creates the correct 'file_spec' objects", {
)
) {
is_src <- TRUE
}
else if
} else if
(!is_data & is_file_spec_type(
fs_source = fs,
path = "data/",
Expand Down Expand Up @@ -581,8 +559,7 @@ testthat::test_that("file_auto() creates the correct 'file_spec' objects", {
)
) {
is_spec_text <- TRUE
}
else if
} else if
(!is_spec_binary & is_file_spec_type(
fs_source = fs,
path = "inst/",
Expand Down