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.139 tracks/clojure/exercises/nucleotide-count/test/nucleotide_count_test.clj
trackler-2.2.1.138 tracks/clojure/exercises/nucleotide-count/test/nucleotide_count_test.clj
trackler-2.2.1.137 tracks/clojure/exercises/nucleotide-count/test/nucleotide_count_test.clj
trackler-2.2.1.136 tracks/clojure/exercises/nucleotide-count/test/nucleotide_count_test.clj
trackler-2.2.1.135 tracks/clojure/exercises/nucleotide-count/test/nucleotide_count_test.clj
trackler-2.2.1.134 tracks/clojure/exercises/nucleotide-count/test/nucleotide_count_test.clj
trackler-2.2.1.133 tracks/clojure/exercises/nucleotide-count/test/nucleotide_count_test.clj
trackler-2.2.1.132 tracks/clojure/exercises/nucleotide-count/test/nucleotide_count_test.clj
trackler-2.2.1.131 tracks/clojure/exercises/nucleotide-count/test/nucleotide_count_test.clj
trackler-2.2.1.130 tracks/clojure/exercises/nucleotide-count/test/nucleotide_count_test.clj
trackler-2.2.1.129 tracks/clojure/exercises/nucleotide-count/test/nucleotide_count_test.clj
trackler-2.2.1.128 tracks/clojure/exercises/nucleotide-count/test/nucleotide_count_test.clj
trackler-2.2.1.127 tracks/clojure/exercises/nucleotide-count/test/nucleotide_count_test.clj
trackler-2.2.1.126 tracks/clojure/exercises/nucleotide-count/test/nucleotide_count_test.clj
trackler-2.2.1.125 tracks/clojure/exercises/nucleotide-count/test/nucleotide_count_test.clj
trackler-2.2.1.124 tracks/clojure/exercises/nucleotide-count/test/nucleotide_count_test.clj
trackler-2.2.1.123 tracks/clojure/exercises/nucleotide-count/test/nucleotide_count_test.clj
trackler-2.2.1.122 tracks/clojure/exercises/nucleotide-count/test/nucleotide_count_test.clj
trackler-2.2.1.121 tracks/clojure/exercises/nucleotide-count/test/nucleotide_count_test.clj
trackler-2.2.1.120 tracks/clojure/exercises/nucleotide-count/test/nucleotide_count_test.clj