Skip to content

Commit

Permalink
Fix shim_help to work with ::: inputs
Browse files Browse the repository at this point in the history
Fixes #72
  • Loading branch information
jimhester committed Jun 29, 2018
1 parent 74b26f4 commit c699550
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* The help shim's now work for `:::` inputs (#72).

# pkgload 1.0.0

* `load_all()` now updates imports of dependent packages when a package is
Expand Down
2 changes: 1 addition & 1 deletion R/dev-topic.r
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dev_topic_find <- function(topic, dev_packages = NULL) {
dev_topic_parse <- function(topic, dev_packages = NULL) {
stopifnot(is.character(topic), length(topic) == 1)

pieces <- strsplit(topic, "::")[[1]]
pieces <- strsplit(topic, ":::?")[[1]]
if (length(pieces) == 1) {
if (is.null(dev_packages)) {
pkgs <- dev_packages()
Expand Down
4 changes: 4 additions & 0 deletions tests/testthat/test-help.r
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ test_that("shim_help behaves the same as utils::help for non-devtools-loaded pac
expect_identical(shim_help('lm', stats)[1], utils::help('lm', stats)[1])
expect_identical(shim_help('lm', 'stats')[1], utils::help('lm', 'stats')[1])
expect_identical(shim_help(, "stats")[1], utils::help(, "stats")[1])

# Works for :: and ::: as well (#72)
expect_identical(shim_help("::")[1], utils::help("::")[1])
expect_identical(shim_help(":::")[1], utils::help(":::")[1])
})

test_that("shim_help behaves the same as utils::help for nonexistent objects", {
Expand Down

0 comments on commit c699550

Please sign in to comment.