Sha256: 5a514912b06ddee3b328a5612e4c162bf5b1a053be5ccb14b7dd8cb5eae4e47e

Contents?: true

Size: 716 Bytes

Versions: 396

Compression:

Stored size: 716 Bytes

Contents

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

(deftest no-difference-between-empty-strands
  (is (= 0 (hamming/distance "" ""))))

(deftest no-difference-between-identical-strands
  (is (= 0 (hamming/distance "GGACTGA" "GGACTGA"))))

(deftest complete-distance-in-small-strand
  (is (= 3 (hamming/distance "ACT" "GGA"))))

(deftest small-distance-in-middle-somewhere
  (is (= 1 (hamming/distance "GGACG" "GGTCG"))))

(deftest larger-distance
  (is (= 2 (hamming/distance "ACCAGGG" "ACTATGG"))))

(deftest undefined-when-lengths-are-different
  (is (= nil (hamming/distance "AAAC" "TAGGGGAGGCTAGCGGTAGGAC")))
  (is (= nil (hamming/distance "GACTACGGACAGGGTAACATAG" "GACA"))))

Version data entries

396 entries across 396 versions & 1 rubygems

Version Path
trackler-2.2.1.159 tracks/clojure/exercises/hamming/test/hamming_test.clj
trackler-2.2.1.158 tracks/clojure/exercises/hamming/test/hamming_test.clj
trackler-2.2.1.157 tracks/clojure/exercises/hamming/test/hamming_test.clj
trackler-2.2.1.156 tracks/clojure/exercises/hamming/test/hamming_test.clj
trackler-2.2.1.155 tracks/clojure/exercises/hamming/test/hamming_test.clj
trackler-2.2.1.154 tracks/clojure/exercises/hamming/test/hamming_test.clj
trackler-2.2.1.153 tracks/clojure/exercises/hamming/test/hamming_test.clj
trackler-2.2.1.152 tracks/clojure/exercises/hamming/test/hamming_test.clj
trackler-2.2.1.151 tracks/clojure/exercises/hamming/test/hamming_test.clj
trackler-2.2.1.150 tracks/clojure/exercises/hamming/test/hamming_test.clj
trackler-2.2.1.149 tracks/clojure/exercises/hamming/test/hamming_test.clj
trackler-2.2.1.148 tracks/clojure/exercises/hamming/test/hamming_test.clj
trackler-2.2.1.147 tracks/clojure/exercises/hamming/test/hamming_test.clj
trackler-2.2.1.146 tracks/clojure/exercises/hamming/test/hamming_test.clj
trackler-2.2.1.145 tracks/clojure/exercises/hamming/test/hamming_test.clj
trackler-2.2.1.144 tracks/clojure/exercises/hamming/test/hamming_test.clj
trackler-2.2.1.143 tracks/clojure/exercises/hamming/test/hamming_test.clj
trackler-2.2.1.142 tracks/clojure/exercises/hamming/test/hamming_test.clj
trackler-2.2.1.141 tracks/clojure/exercises/hamming/test/hamming_test.clj
trackler-2.2.1.140 tracks/clojure/exercises/hamming/test/hamming_test.clj