tests/testthat/test-reverse_translate.R

context("test-reverse_translate")

test_that("length output 3 times input", {
  expect_equal(nchar(reverse_translate(amino_acid_seq = minimal_aa_seq, codon_tbl = minimal_freq_tbl)),
                3 * nchar(minimal_aa_seq))
  expect_equal(nchar(reverse_translate(amino_acid_seq = "X", codon_tbl = minimal_freq_tbl)),
               3 * nchar("X"))
})

test_that("lower okay", {
  expect_equal(nchar(reverse_translate(amino_acid_seq = tolower(minimal_aa_seq), codon_tbl = minimal_freq_tbl)),
               3 * nchar(minimal_aa_seq))
})
greg-botwin/reversetranslate documentation built on Aug. 24, 2019, 4:04 a.m.