Sha256: c992f0aebb93e32b95651f75f09876fd29945be1a7cc86fee5c4f67dd0daa570

Contents?: true

Size: 1.22 KB

Versions: 396

Compression:

Stored size: 1.22 KB

Contents

;; Load SRFI-64 lightweight testing specification
(use-modules (srfi srfi-64))

;; Suppress log file output. To write logs, comment out the following line:
(module-define! (resolve-module '(srfi srfi-64)) 'test-log-to-file #f)

(add-to-load-path (dirname (current-filename)))
(use-modules (nucleotide-count))



(test-begin "nucleotide-count")

(test-eqv "empty-dna-strand-has-no-adenine"
          0
          (dna-count #\A ""))

(test-equal "empty-dna-strand-has-no-nucleotides"
            '((#\A . 0) (#\C . 0) (#\G . 0) (#\T . 0))
            (nucleotide-counts ""))

(test-eqv "repetitive-cytosine-gets-counted"
          5
          (dna-count #\C "CCCCC"))

(test-equal "repetitive-sequence-has-only-guanine"
            '((#\A . 0) (#\C . 0) (#\G . 8) (#\T . 0))
            (nucleotide-counts "GGGGGGGG"))

(test-eqv "counts-only-thymine"
          1
          (dna-count #\T "GGGGGTAACCCGG"))

(test-error "validates-nucleotides"
            #t
            (dna-count #\X "ACGT")
            )

(test-equal "counts-all-nucleotides"
            '((#\A . 20) (#\C . 12) (#\G . 17) (#\T . 21))
            (nucleotide-counts
             "AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC"))

(test-end "nucleotide-count")

Version data entries

396 entries across 396 versions & 1 rubygems

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