Skip to content

Commit

Permalink
Fix R-CMD-check
Browse files Browse the repository at this point in the history
  • Loading branch information
danielvartan committed Sep 5, 2024
1 parent 99c7af9 commit b15a1ed
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 33 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ License: MIT + file LICENSE
URL: https://github.com/danielvartan/prettycheck/
BugReports: https://github.com/danielvartan/prettycheck/issues/
Depends:
R (>= 4.4)
R (>= 4.3)
Imports:
checkmate (>= 2.3.2),
cli (>= 3.6.3),
Expand All @@ -31,7 +31,7 @@ Imports:
rutils,
stringr (>= 1.5.1),
tibble (>= 3.2.1),
utils (>= 4.4.1)
utils (>= 4.3)
Suggests:
covr (>= 3.6.4),
knitr (>= 1.48),
Expand Down
8 changes: 4 additions & 4 deletions R/identical.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,27 @@
#' @examples
#' x <- 1; y <- 1
#' test_identical(x, y, type = "value")
#' #> TRUE # Expected
#' #> [1] TRUE # Expected
#'
#' x <- 1; y <- 2
#' check_identical(x, y, type = "value")
#' #> ! x and y must have identical values. # Expected
#'
#' x <- letters; y <- LETTERS
#' test_identical(x, y, type = "length")
#' #> TRUE # Expected
#' #> [1] TRUE # Expected
#'
#' x <- letters; y <- 1:2
#' check_identical(x, y, type = "length")
#' #> ! x and y must have identical lengths. # Expected
#'
#' x <- "a"; y <- c("a", "b")
#' test_identical(x, y, type = "class")
#' #> TRUE # Expected
#' #> [1] TRUE # Expected
#'
#' x <- "a"; y <- 1
#' check_identical(x, y, type = "class")
#' #> ! x and y must have identical classes. # Expected
#' #> ! x and y must belong to the same class. # Expected
test_identical <- function(..., type = "value") {
assert_length(list(...), min_len = 2)
assert_choice(type, c("value", "length", "class"))
Expand Down
33 changes: 10 additions & 23 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,26 @@ navbar:
- reference
- articles
- news
right: github
right:
- search
- lightswitch
- github
components:
home: ~
intro: ~
articles: ~

reference:
- title: Tests
desc: >
`test_*()` functions return a logical flag.
contents:
- test_identical

- title: Checks
desc: >
`check_*()` functions return a logical flag and throw a warning message if
the condition is not met.
contents:
- check_identical

- title: Assertions
desc: >
assert_*()` functions return a logical flag and throw an error if the
`prettycheck` includes four main types of functions: `test_*()`,
`check_*()`, `assert_*()`, and `expect_*()`. The `test_*()` functions
return a logical flag; the `check_*()` functions return a logical flag and
throw a warning message if the condition is not met; and the`assert_*()`
and `expect_*()` functions return a logical flag and throw an error if the
condition is not met.
contents:
- assert_identical

- title: Expectations
desc: >
expect_*()` functions return a logical flag and throw anerror if the
condition is not met (it differs from the error thrown by `assert_*()`).
contents:
- assert_identical
- test_identical

authors:
Daniel Vartanian:
Expand Down
8 changes: 4 additions & 4 deletions man/test_identical.Rd

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

0 comments on commit b15a1ed

Please sign in to comment.