Skip to content

Commit

Permalink
remove double underscore
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpcouch committed Oct 11, 2024
1 parent 3f2fb69 commit b79f590
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion R/gadget.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

server <- function(input, output, session) {
shiny::observeEvent(input$done, {
shiny::stopApp(returnValue = paste0(".pal_rs__", input$pal))
shiny::stopApp(returnValue = paste0(".pal_rs_", input$pal))
})
shiny::onStop(function() {
shiny::stopApp(returnValue = NULL)
Expand Down
4 changes: 2 additions & 2 deletions R/pal-add-remove.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pal_remove <- function(role) {

env_unbind(
pal_env(),
c(paste0(".pal_prompt_", role), paste0(".pal_rs__", role))
c(paste0(".pal_prompt_", role), paste0(".pal_rs_", role))
)

if (paste0(".pal_last_", role) %in% names(pal_env())) {
Expand Down Expand Up @@ -96,5 +96,5 @@ parse_interface <- function(interface, role, call = caller_env()) {
}
)

paste0(".pal_rs__", role)
paste0(".pal_rs_", role)
}
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

.stash_binding <- function(role, fn) {
pal_env <- pal_env()
pal_env[[paste0(".pal_rs__", role)]] <- fn
pal_env[[paste0(".pal_rs_", role)]] <- fn
invisible(NULL)
}

Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-pal-add-remove.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ test_that("pal addition and removal works", {
pal_add("boopery", boop_prompt)

expect_equal(.pal_prompt_boopery, boop_prompt)
expect_true(is_function(.pal_rs__boopery))
expect_true(is_function(.pal_rs_boopery))
expect_true(".pal_prompt_boopery" %in% names(pal_env()))
expect_true(".pal_rs__boopery" %in% names(pal_env()))
expect_true(".pal_rs_boopery" %in% names(pal_env()))

pal_boopery <- pal("boopery")
expect_snapshot(pal_boopery)
Expand All @@ -22,7 +22,7 @@ test_that("pal addition and removal works", {

expect_false(".pal_last_boopery" %in% names(pal_env()))
expect_false(".pal_prompt_boopery" %in% names(pal_env()))
expect_false(".pal_rs__boopery" %in% names(pal_env()))
expect_false(".pal_rs_boopery" %in% names(pal_env()))
})

test_that("pal addition with bad inputs", {
Expand Down

0 comments on commit b79f590

Please sign in to comment.