tests/testthat/testSplitArgs.R

context("SplitArgs")

test_that("SplitArgs works", {

  a <- SplitArgs("moduleName(parameter = 2, parameter2 = 3)")
  b <- SplitArgs("moduleName")

  # Interesting to note that SplitArgs doesn't deal with numerics at all.
  #   Probably needs looking into.
  expect_equal(a,
               list(module = "moduleName",
                    paras = list(parameter = "2",
                                 parameter2 = "3")))
  expect_equal(b,
               list(module = "moduleName",
                    paras = list()))
})

Try the zoon package in your browser

Any scripts or data that you put into this service are public.

zoon documentation built on Feb. 28, 2020, 5:09 p.m.