tests/testthat/test_recompose_path.R

test_that(
  "recompose_path is the inverse of decompose_path, except standardized",
  {
    skip_on_cran()
    x <- c(
      character(),
      NULL,
      "foo.tgz",
      "somedir/foo.tgz",
      "foo.tar.gz",
      "somedir/foo.tar.gz",
      "foo",
      "somedir/foo",
      "foo. bar.zip",
      "somedir\\foo.tgz",
      "somedir\\another dir/foo.tgz",
      R.home(),
      "~",
      "~/foo.tgz",
      ".",
      "..",
      "./foo.tgz",
      "",
      NA
    )
    expected <- standardize_path(x)
    actual <- recompose_path(decompose_path(x))
    expect_equivalent(actual, expected)
  }
)

Try the pathological package in your browser

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

pathological documentation built on May 29, 2017, 1:41 p.m.