tests/testthat/tests/test-circular_cut.R

##' Unit tests (Am I supposed to put all of these in one file?)
##'
context("Circular subsetting a single sequence")

test.str <- str_c(letters, collapse = "")

# Subsetting from the beginning of the sequence
expect_equal(
  circular_cut(seq = test.str, len = 5, start.pos = 1),
  "abcde"
)

# Subsetting across the end of the sequence
expect_equal(
  circular_cut(seq = test.str, len = 5, start.pos = 23),
  "wxyza"
)

# Subsetting from the very end of the sequence
expect_equal(
  circular_cut(seq = test.str, len = 5, start.pos = 26),
  "zabcd"
)
adsteen/genomechop documentation built on May 18, 2019, 8:11 p.m.