Sha256: 88ff468d31decae29ca31a11954e4cc120dbd4f4dc26765706c94c547988455e

Contents?: true

Size: 1019 Bytes

Versions: 396

Compression:

Stored size: 1019 Bytes

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 (hamming))

(test-begin "hamming")

(test-eqv "no-difference-between-empty-strands"
          0
          (hamming-distance "" ""))

(test-eqv "no-difference-between-identical-strands"
          0
          (hamming-distance "GATTACA" "GATTACA"))

(test-eqv "complete-hamming-distance-in-small-strand"
          3
          (hamming-distance "ACT" "GGA"))

(test-eqv "small-hamming-distance-in-middle-somewhere"
          1
          (hamming-distance "GGACG" "GGTCG"))

(test-eqv "larger-difference"
          2
          (hamming-distance "ACCAGGG" "ACTATGG"))

(test-error "invalid-to-get-distance-for-different-length-strings"
         #t
         (hamming-distance "AGACAACAGCCAGCCGCCGGATT" "AGGCAA"))


(test-end "hamming")

Version data entries

396 entries across 396 versions & 1 rubygems

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