Sha256: 4683972a4d876893107349f7dfea21240a50c508fa33a734b7173ed705b05a30

Contents?: true

Size: 958 Bytes

Versions: 396

Compression:

Stored size: 958 Bytes

Contents

(ns nucleotide-count-test
  (:require [clojure.test :refer [deftest is]]
            nucleotide-count))

(deftest empty-dna-strand-has-no-adenosine
  (is (= 0 (nucleotide-count/count \A, ""))))

(deftest empty-dna-strand-has-no-nucleotides
  (is (= {\A 0, \T 0, \C 0, \G 0}
         (nucleotide-count/nucleotide-counts ""))))

(deftest repetitive-cytidine-gets-counted
  (is (= 5 (nucleotide-count/count \C "CCCCC"))))

(deftest repetitive-sequence-has-only-guanosine
  (is (= {\A 0, \T 0, \C 0, \G 8}
         (nucleotide-count/nucleotide-counts "GGGGGGGG"))))

(deftest counts-only-thymidine
  (is (= 1 (nucleotide-count/count \T "GGGGGTAACCCGG"))))

(deftest validates-nucleotides
  (is (thrown? Throwable (nucleotide-count/count \X "GACT"))))

(deftest counts-all-nucleotides
  (let [s "AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC"]
    (is (= {\A 20, \T 21, \G 17, \C 12}
           (nucleotide-count/nucleotide-counts s)))))

Version data entries

396 entries across 396 versions & 1 rubygems

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