File: test_file_subs_ext.R

package info (click to toggle)
r-cran-simplermarkdown 0.0.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 392 kB
  • sloc: makefile: 2
file content (21 lines) | stat: -rw-r--r-- 375 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
library(simplermarkdown)

expect_equal <- function(a, b) {
  stopifnot(isTRUE(all.equal(a,b)))
}

expect_equal(
  file_subs_ext("foo.x", "y"), 
  "foo.y")

expect_equal(
  file_subs_ext(c("foo.x", "bar.z"), "y"), 
  c("foo.y", "bar.y"))

expect_equal(
  file_subs_ext(c(".x", "foo/.bar.z"), "y"), 
  c(".x.y", "foo/.bar.y"))

expect_equal(
  file_subs_ext("", "y"), 
  ".y")