Sha256: 86870b55f46ab9e6dd19c255cf37aea1b7329a83666201b237a4d9d82569d2e5

Contents?: true

Size: 942 Bytes

Versions: 26

Compression:

Stored size: 942 Bytes

Contents

source("./rna-transcription.R")
library(testthat)

test_that("rna complement of cytosine is guanine", {
  dna <- "C"
  expect_equal(to_rna(dna), "G")
})

test_that("rna complement of guanine is cytosine", {
  dna <- "G"
  expect_equal(to_rna(dna), "C")
})

test_that("rna complement of thymine is adenine", {
  dna <- "T"
  expect_equal(to_rna(dna), "A")
})

test_that("rna complement of adenine is uracil", {
  dna <- "A"
  expect_equal(to_rna(dna), "U")
})

test_that("rna complement", {
  dna <- "ACGTGGTCTTAA"
  expect_equal(to_rna(dna), "UGCACCAGAAUU")
})

test_that("dna correctly handles invalid input", {
  dna <- "U"
  expect_error(to_rna(dna))
})

test_that("dna correctly handles completely invalid input", {
  dna <- "XXX"
  expect_error(to_rna(dna))
})

test_that("dna correctly handles partially invalid input", {
  dna <- "ACGTXXXCTTAA"
  expect_error(to_rna(dna))
})

print("All tests passed for exercise: rna-transcription")

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
trackler-2.1.0.48 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.1.0.47 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.1.0.46 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.1.0.45 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.1.0.44 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.1.0.43 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.1.0.42 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.1.0.41 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.1.0.40 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.1.0.39 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.1.0.38 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.1.0.37 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.1.0.36 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.1.0.34 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.1.0.33 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.1.0.32 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.1.0.31 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.1.0.30 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.1.0.29 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.1.0.28 tracks/r/exercises/rna-transcription/test_rna-transcription.R