Skip to content

Commit

Permalink
chore: test NS when it returns a functiont push
Browse files Browse the repository at this point in the history
  • Loading branch information
averissimo committed Oct 24, 2024
1 parent 9fdf441 commit 7be5992
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/testthat/test-utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ testthat::test_that("make_c_call", {
testthat::expect_identical(make_c_call(1), 1)
})

# sanitize_id ----
testthat::describe("sanitize_id", {
testthat::it("should replace non-ASCII characters in middle of id with `_`", {
id <- "a$b"
ns <- NS("app")
testthat::expect_identical(
NS("app", id),
ns(id),
paste0("app-", substr(rlang::hash(id), 1, 4), "_a_b")
)
})
Expand Down

0 comments on commit 7be5992

Please sign in to comment.