Sha256: 890555127d43bc41f6f112f6af6a2a0ed1da916bd45ac0b9d8af5edeebd04cb9

Contents?: true

Size: 971 Bytes

Versions: 396

Compression:

Stored size: 971 Bytes

Contents

(defmodule dna-tests
  (behaviour ltest-unit)
  (export all))

(include-lib "ltest/include/ltest-macros.lfe")

(deftest empty-dna-sting-has-no-adenine
  (is-equal 0 (dna:count "" "A")))

(deftest repetitive-cytosine-gets-counted
  (is-equal 5 (dna:count "CCCCC" "C")))

(deftest counts-only-thymine
  (is-equal 1 (dna:count "GGGGGTAACCCGG" "T")))

(deftest validates-nucleotides
  (is-error _ (dna:count "GACT" "X")))

(deftest validates-strand
  (is-error _ (dna:count "GACYT" "G")))

(deftest empty-dna-string-has-no-nucleotides
  (is-equal `(#("A" 0) #("C" 0) #("G" 0) #("T" 0))
            (dna:nucleotide-counts "")))

(deftest repetitive-sequence-has-only-guanine
  (is-equal `(#("A" 0) #("C" 0) #("G" 8) #("T" 0))
            (dna:nucleotide-counts "GGGGGGGG")))

(deftest counts-all-nucleotides
  (is-equal
    `(#("A" 20) #("C" 12) #("G" 17) #("T" 21))
    (dna:nucleotide-counts
      "AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC")))

Version data entries

396 entries across 396 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/lfe/exercises/nucleotide-count/test/dna-tests.lfe
trackler-2.2.1.179 tracks/lfe/exercises/nucleotide-count/test/dna-tests.lfe
trackler-2.2.1.178 tracks/lfe/exercises/nucleotide-count/test/dna-tests.lfe
trackler-2.2.1.177 tracks/lfe/exercises/nucleotide-count/test/dna-tests.lfe
trackler-2.2.1.176 tracks/lfe/exercises/nucleotide-count/test/dna-tests.lfe
trackler-2.2.1.175 tracks/lfe/exercises/nucleotide-count/test/dna-tests.lfe
trackler-2.2.1.174 tracks/lfe/exercises/nucleotide-count/test/dna-tests.lfe
trackler-2.2.1.173 tracks/lfe/exercises/nucleotide-count/test/dna-tests.lfe
trackler-2.2.1.172 tracks/lfe/exercises/nucleotide-count/test/dna-tests.lfe
trackler-2.2.1.171 tracks/lfe/exercises/nucleotide-count/test/dna-tests.lfe
trackler-2.2.1.170 tracks/lfe/exercises/nucleotide-count/test/dna-tests.lfe
trackler-2.2.1.169 tracks/lfe/exercises/nucleotide-count/test/dna-tests.lfe
trackler-2.2.1.167 tracks/lfe/exercises/nucleotide-count/test/dna-tests.lfe
trackler-2.2.1.166 tracks/lfe/exercises/nucleotide-count/test/dna-tests.lfe
trackler-2.2.1.165 tracks/lfe/exercises/nucleotide-count/test/dna-tests.lfe
trackler-2.2.1.164 tracks/lfe/exercises/nucleotide-count/test/dna-tests.lfe
trackler-2.2.1.163 tracks/lfe/exercises/nucleotide-count/test/dna-tests.lfe
trackler-2.2.1.162 tracks/lfe/exercises/nucleotide-count/test/dna-tests.lfe
trackler-2.2.1.161 tracks/lfe/exercises/nucleotide-count/test/dna-tests.lfe
trackler-2.2.1.160 tracks/lfe/exercises/nucleotide-count/test/dna-tests.lfe