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.126 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.125 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.124 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.123 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.122 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.121 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.120 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.119 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.118 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.117 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.116 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.115 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.114 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.113 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.111 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.110 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.109 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.108 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.107 tracks/r/exercises/rna-transcription/test_rna-transcription.R
trackler-2.2.1.106 tracks/r/exercises/rna-transcription/test_rna-transcription.R