Skip to content
Open
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: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: forge
Type: Package
Title: Casting Values into Shape
Version: 0.2.0
Version: 0.2.1
Authors@R: c(
person("Kevin", "Kuo", role = c("aut", "cre"), email = "kevin.kuo@rstudio.com",
comment = c(ORCID = "0000-0001-7803-7901"))
Expand Down
4 changes: 2 additions & 2 deletions R/cast.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ cast_integer <- function(x, n = NULL, allow_na = FALSE, allow_null = FALSE, id =
verify_length_na(x, n, allow_na, id = id)

if (!rlang::is_integerish(x)) stop(
backticks(id), " cannot be casted to an integer vector.",
backticks(id), " cannot be cast to an integer vector.",
call. = FALSE
)

Expand Down Expand Up @@ -90,7 +90,7 @@ cast_double <- function(x, n = NULL, allow_na = FALSE, allow_null = FALSE, id =
verify_length_na(x, n, allow_na, id = id)

if (!rlang::is_double(x) && !rlang::is_integerish(x)) stop(
backticks(id), " cannot be casted to a double vector.",
backticks(id), " cannot be cast to a double vector.",
call. = FALSE
)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fib(10)

``` r
fib(1.5)
#> Error: `n` cannot be casted to an integer vector.
#> Error: `n` cannot be cast to an integer vector.
```

``` r
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-cast.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ test_that("cast_integer() works properly", {

expect_error(cast_integer(NULL), "`x` must not be NULL\\.")
expect_error(cast_integer(1:3, 2), "`x` must be of length 2, but is of length 3\\.")
expect_error(cast_integer(1.2), "`x` cannot be casted to an integer vector\\.")
expect_error(cast_integer(1.2), "`x` cannot be cast to an integer vector\\.")
expect_error(cast_integer(NA), "`x` must not contain NAs\\.")
expect_error(cast_integer(1:2, c(1, 2)), "`n` must be an integer\\.")
expect_error(cast_scalar_integer(1:3), "`x` must be of length 1, but is of length 3\\.")
Expand Down Expand Up @@ -99,5 +99,5 @@ test_that("cast_logical() works properly", {

test_that("`id` argument works", {
foo <- 4.5
expect_error(cast_scalar_integer(foo), "`foo` cannot be casted to an integer vector\\.")
expect_error(cast_scalar_integer(foo), "`foo` cannot be cast to an integer vector\\.")
})