Sha256: d3ee9be4d82c9ea2d7cf0856bc967ead9d9ecd488dc78d6d8b68b26719b46ad7

Contents?: true

Size: 999 Bytes

Versions: 304

Compression:

Stored size: 999 Bytes

Contents

;;; hamming-test.el --- Tests for hamming (exercism)

;;; Commentary:

;;; Code:

(load-file "hamming.el")

(ert-deftest no-difference-between-empty-strands ()
  (should (= 0 (hamming-distance "" ""))))

(ert-deftest no-difference-between-identical-strands ()
  (should (= 0 (hamming-distance "GATTACA" "GATTACA"))))

(ert-deftest complete-hamming-distance-in-small-strand ()
  (should (= 3 (hamming-distance "ACT" "GGA"))))

(ert-deftest small-hamming-distance-in-middle-somwhere ()
  (should (= 1 (hamming-distance "GGACG" "GGTCG"))))

(ert-deftest larger-distance ()
  (should (= 2 (hamming-distance "ACCAGGG" "ACTATGG"))))

(ert-deftest invalid-to-get-distance-for-different-length-strings ()
  (should-error (hamming-distance "AGACAACAGCCAGCCGCCGGATT" "AGGCAA"))
  (should-error (hamming-distance
                 "AGACAACAGCCAGCCGCCGGATT" "AGACATCTTTCAGCCGCCGGATTAGGCAA"))
  (should-error (hamming-distance "AGG" "CATCATCATCATCATGAT")))


(provide 'hamming-test)
;;; hamming-test.el ends here

Version data entries

304 entries across 304 versions & 1 rubygems

Version Path
trackler-2.2.1.6 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.1.5 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.1.4 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.1.3 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.1.2 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.1.1 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.1.0 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.0.6 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.0.5 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.0.4 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.0.3 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.0.2 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.0.1 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.2.0.0 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.1.0.55 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.1.0.54 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.1.0.53 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.1.0.52 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.1.0.51 tracks/elisp/exercises/hamming/hamming-test.el
trackler-2.1.0.50 tracks/elisp/exercises/hamming/hamming-test.el