Skip to content

Commit

Permalink
Merge fff9771 into 688cfe1
Browse files Browse the repository at this point in the history
  • Loading branch information
kiwiroy committed Jul 5, 2019
2 parents 688cfe1 + fff9771 commit 08195bf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: perlbrewr
Title: Integrates Perlbrew With R, Specifically (knitr & rmarkdown)
Version: 0.0.0.9000
Version: 0.0.1.9000
Authors@R: c(
person("Roy", "Storey", email = "kiwiroy@gmail.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-1375-7136")))
Description: The goal of perlbrewr is to assist the loading of a perlbrew
Expand Down
4 changes: 3 additions & 1 deletion R/knitr-shellwords.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ shellwords <- function(x) {
)
)"
xo <- str_match_all(string = x, pattern = shellwords_re)

if (length(xo) == 0) {
return(character(0))
}
for (i in seq_along(xo[[1]][,1])) {
xo[[1]][i,7] <- NA
if(!is.na(xo[[1]][i,6]) && xo[[1]][i,6] != "") {
Expand Down
6 changes: 6 additions & 0 deletions tests/testthat/test-90-regression.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
context("regression tests")

test_that("regression - handle NULL from knitr::opts_chunk$get('engine.opts')$perl ", {
words <- perlbrewr:::shellwords(x = NULL)
expect_equal(words, character(0))
})

0 comments on commit 08195bf

Please sign in to comment.