Sha256: 9879ba59653fd69f1740378fb83b2f8a96d29b60917e6d8d83061ec7e7dcade8

Contents?: true

Size: 944 Bytes

Versions: 140

Compression:

Stored size: 944 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))
})

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

Version data entries

140 entries across 140 versions & 1 rubygems

Version Path
trackler-2.2.1.105 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.104 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.103 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.102 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.101 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.100 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.99 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.98 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.97 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.96 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.95 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.94 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.93 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.92 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.91 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.90 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.89 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.88 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.87 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.86 tracks/r/exercises/rna-transcription/test_rna-transcription.R